|
List comprehensions ranges: msg#00003lang.nemerle.devel
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@xxxxxxxxxxxxxxxx>
|
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | Re: extension methods for local function., Michal Moskal |
|---|---|
| Next by Date: | Re: macros attached to methods, Kamil Skalski |
| Previous by Thread: | extension methods for local function., mei |
| Next by Thread: | Re: List comprehensions ranges, Kamil Skalski |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |