Re: [Felix-language] Named function arguments

2007-09-20 Thread skaller
Ok, one argument (and procedures) now works: / #import fun f(a:int)=> 3 * a; println$ f 2; println$ f (a=4); fun g(x:struct {a:int;})=>9 * x.a; println$ g (a=2); / NOTE: Client Error binding expression (g struct {x=struct {a=

Re: [Felix-language] Named function arguments

2007-09-20 Thread skaller
On Thu, 2007-09-20 at 20:15 +1000, skaller wrote: > Still .. you could just do that for function overload > candidates one by one... hmm.. Actually, the biggest problem here is that any change which records the defaults for a function, will require changing the most commonly used terms in the com

Re: [Felix-language] Named function arguments

2007-09-20 Thread skaller
On Thu, 2007-09-20 at 00:51 -0700, Erick Tryzelaar wrote: > On 9/20/07, skaller <[EMAIL PROTECTED]> wrote: > > Now, actually I lied about 2^N: if we follow the C++/tuple technology, > > then N defaults only makes N+1 functions (all args, the last one > > cut off, the last 2 cut off, etc ..). > > >

Re: [Felix-language] Named function arguments

2007-09-20 Thread Erick Tryzelaar
On 9/20/07, skaller <[EMAIL PROTECTED]> wrote: > > Someday. I'm doing a bit of work on those os wrappers, and it'd really > > simplify the interface :) > > The main issue is that a given function would have a SET of type > signatures. > > I think overload resolution could handle that easily: instea

Re: [Felix-language] Named function arguments

2007-09-20 Thread skaller
On Wed, 2007-09-19 at 23:11 -0700, Erick Tryzelaar wrote: > > You can't mix positional and named arguments. > > I doubt this would make a lot of sense with overloading. > > You mean something like: > > fun f(a:int, b:int) = {...} > f (1, b=2); > > ? Yeah, while I think it could be a useful

Re: [Felix-language] Named function arguments

2007-09-19 Thread Erick Tryzelaar
On 9/19/07, skaller <[EMAIL PROTECTED]> wrote: > For functions you can now use named arguments. Cool! > Argument names contribute to overload resolution. Also cool! > Oh well: > > You can't mix positional and named arguments. > I doubt this would make a lot of sense with overloading. You m

[Felix-language] Named function arguments

2007-09-19 Thread skaller
For functions you can now use named arguments. Argument names contribute to overload resolution. // #import fun f(a:int, b:int)=> a + 2* b; fun f(x:int, y:int)=> 2 * x + 5* y; var d = f(b=1,a=2); // 4 println q"d=$(d)"; d = f(x=1,y=2); // 12 println q"d=$