[nem-en] about local functions

Kamil Skalski kamil.skalski at gmail.com
Tue Dec 19 10:48:52 CET 2006


>   i'm defining local function:
>
>       def chainInsideDecl(decl : Decl)
>       {
>         | GlobalAttribute => []
>         | Using => []
>         | Namespace => []
>         | Type(typeBuilder) => []
>         | _ => []
>       }
>
>   i need to specify type decl : Decl, then i can define match cases
>   without specifying full names of variants (e.g. not Decl.Namespace,
>   just Namespace instead)
>
>   however, if i omit specifying type in a definition:
>
>       def chainInsideDecl(decl)
>
>   it doesn't compile, although a type of decl is inferred
>   need this situtation an enhancing?

It is a lack of feature:
http://nemerle.org/bugs/view.php?id=773

>
>   btw, do local funcitons support overloading?
>
>

Currently not, they are just defining new variable in scope, like:

def myfunc = fun (x) {  };
def myfunc = fun (x, y ) {  };  // ?


-- 
Kamil Skalski
http://nazgul.omega.pl



More information about the devel-en mailing list