3 ms·
I don't remember much of Ada, but here's something very basic I liked (had to look the details up): You could declare custom integer types like this: type My_
by vba616 3y ago
I don't remember much of Ada, but here's something very basic I liked (had to look the details up):
You could declare custom integer types like this:
type My_Type is range -5 .. 10;
And then you could reference the range with My_Type'First or My_Type'Last
And there were named parameters.
for A in Range_Type loop
I_IO.Put (
Item => A,
Width => 3,
Base => 10);
...
end loop;
- cb321 3y agoNim [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/