3 ms·
Nim [1] is like Ada in these ways but less verbose: import strutils # Or from strutils import repeat Or etc. type Foo = -5 .. 10 # Or ra
by cb321 3y ago
Nim [1] is like Ada in these ways but less verbose:
import strutils # Or from strutils import repeat Or etc.
type Foo = -5 .. 10 # Or range[-5 .. 10]
echo Foo.low, " ", Foo.high # range limits
echo repeat(s = "x", n = Foo.high) # named params
# var f: Foo = 15 # Will not compile
[1] https://nim-lang.org/ https://nim-lang.org/