|
|
|
|
|
by cb321
1073 days 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/ |
|