[nem-en] List comprehensions ranges
mei
mei at work.email.ne.jp
Fri May 5 17:57:16 CEST 2006
Hi,
List comprehensions ranges is now,
$ [begin .. end]
this mean begin <= x <= end.
for example
def arr = array [1, 2, 3, 4, 5];
foreach (i in $[0 .. arr.Length -1])
Console.Write ($"$(arr[i]) ");
I think "arr.Length - 1" is undesirable.
Programming Language Ruby has following syntax.
0 .. 5 : 1 2 3 4 5
0 ... 5 : 1 2 3 4
If Nemerle supported this then
foreach (i in $[0 ... arr.Length])
Console.Write ($"$(arr[i]) ");
Isn't it useful?
--
akiramei <mei at work.email.ne.jp>
More information about the devel-en
mailing list