|
extension methods for local function.: msg#00001lang.nemerle.devel
Hi, I tryed to use extension methods for local function. but compile error occurred. Is this by design? -- sample.n using System; using Nemerle.Collections; def foldl (this ls, acc, fn) { match (ls) { | x::xs => foldl (xs, fn (acc, x), fn); | _ => acc; } } def foldr (this ls, acc, fn) { match (ls) { | x::xs => fn (x, foldr(xs, acc, fn)); | _ => acc; } } def ls = [1, 2, 3]; // compile error ! // there is no member named `foldr' in list.Cons[int-] with type ? Console.WriteLine (ls.foldl (0, _ - _)); Console.WriteLine (ls.foldr (0, _ - _)); -- akiramei <mei@xxxxxxxxxxxxxxxx>
|
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | macros attached to methods, Michal Moskal |
|---|---|
| Next by Date: | Re: extension methods for local function., Michal Moskal |
| Previous by Thread: | macros attached to methods, Michal Moskal |
| Next by Thread: | Re: extension methods for local function., Michal Moskal |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |