Re: [Felix-language] default arguments for a record

2007-07-31 Thread skaller
On Tue, 2007-07-31 at 10:31 -0700, Erick Tryzelaar wrote: > I've got no idea how this could be implemented and typed though. BTW2: you can do this: typedef XY = { x:int; y:long; }; typedef XYZ = {x:int; y:long; z:float; }; fun f(a:XY) ... var xyz = { x=1; y=2L; z

Re: [Felix-language] default arguments for a record

2007-07-31 Thread skaller
On Tue, 2007-07-31 at 10:31 -0700, Erick Tryzelaar wrote: > On 7/31/07, skaller <[EMAIL PROTECTED]> wrote: > I kind of like this idea. It feels lispy. Say { ... } actually created > a raw stack frame, where the thing it was passed to had access to all > the internal values and variables. This raw

Re: [Felix-language] default arguments for a record

2007-07-31 Thread Erick Tryzelaar
On 7/31/07, skaller <[EMAIL PROTECTED]> wrote: > > This can help a little with emulating keyword arguments to a function, > > with something ugly like this: > > On todo list .. the syntax sucks with keyword 'struct' needed, > but { .. } has two other meanings as a closure for both > procedures and

Re: [Felix-language] default arguments for a record

2007-07-31 Thread skaller
On Tue, 2007-07-31 at 00:50 -0700, Erick Tryzelaar wrote: > We don't support ocaml's "with" construct with our records yet, do we? Nope. It could be done I guess, with compiler support and caveats: > val x = struct { a = 5; b = 6; }; > val y = struct { x with a = 1; }; // equals struct { a = 1;

[Felix-language] default arguments for a record

2007-07-31 Thread Erick Tryzelaar
We don't support ocaml's "with" construct with our records yet, do we? For those unfamiliar with this, it would be something like this in pseudo-felix: val x = struct { a = 5; b = 6; }; val y = struct { x with a = 1; }; // equals struct { a = 1; b = 6; } This can help a little with emulating ke