Re: [Felix-language] New ctor syntax

2007-09-19 Thread skaller
On Thu, 2007-09-20 at 00:35 +1000, skaller wrote: > On Wed, 2007-09-19 at 16:45 +1000, skaller wrote: > Now .. whilst coding this I am thinking on this one: > > fun f(a:int, b:int) .. > fun f(x:int, y:int) > > f(x=1, y=2) //calls the second b OK, I'm looking at this. Some thin

Re: [Felix-language] New ctor syntax

2007-09-19 Thread skaller
On Wed, 2007-09-19 at 16:45 +1000, skaller wrote: > Anyhow .. this CAN be done. And now has been: / #import var x = struct {a=1; b=2; }; println q"a=$(x.a), b=$(x.b)"; var y = (a=3, b=4); println q"a=$(y.a), b=$(y.b)"; struct X { aa:int; bb:int; }; val k

Re: [Felix-language] New ctor syntax

2007-09-18 Thread skaller
On Tue, 2007-09-18 at 22:45 -0700, Erick Tryzelaar wrote: > On 9/18/07, skaller <[EMAIL PROTECTED]> wrote: > > Well, they're not interchangeable since (1,2) doesn't specify > > any labels. > > Thats okay. Are you planning on implementing it? > > > in any case this now works: > > Cool! Oh, do you

Re: [Felix-language] New ctor syntax

2007-09-18 Thread Erick Tryzelaar
On 9/18/07, skaller <[EMAIL PROTECTED]> wrote: > Well, they're not interchangeable since (1,2) doesn't specify > any labels. Thats okay. Are you planning on implementing it? > in any case this now works: Cool! Oh, do you think we could declare types this way too? Maybe: typedef foo = (a:int, b:

Re: [Felix-language] New ctor syntax

2007-09-18 Thread skaller
On Tue, 2007-09-18 at 22:02 -0700, Erick Tryzelaar wrote: > On 9/18/07, skaller <[EMAIL PROTECTED]> wrote: > > On Tue, 2007-09-18 at 21:04 -0700, Erick Tryzelaar wrote: > > > On 9/18/07, skaller <[EMAIL PROTECTED]> wrote: > > > > > The tildes are probably the easiest to read and notice. > > > > Exc

Re: [Felix-language] New ctor syntax

2007-09-18 Thread Erick Tryzelaar
On 9/18/07, skaller <[EMAIL PROTECTED]> wrote: > On Tue, 2007-09-18 at 21:04 -0700, Erick Tryzelaar wrote: > > On 9/18/07, skaller <[EMAIL PROTECTED]> wrote: > > > The tildes are probably the easiest to read and notice. > > Except ~ means complement as an operator and 'destructor' in > C++, but the

Re: [Felix-language] New ctor syntax

2007-09-18 Thread skaller
On Tue, 2007-09-18 at 21:04 -0700, Erick Tryzelaar wrote: > On 9/18/07, skaller <[EMAIL PROTECTED]> wrote: > The tildes are probably the easiest to read and notice. Except ~ means complement as an operator and 'destructor' in C++, but the issue is more with the calling syntax IMHO. -- John Skal

Re: [Felix-language] New ctor syntax

2007-09-18 Thread skaller
On Tue, 2007-09-18 at 21:04 -0700, Erick Tryzelaar wrote: > On 9/18/07, skaller <[EMAIL PROTECTED]> wrote: > Now that would be useful. We might need a prefix to those values > though, so then we could use this in function declarations. This may > help to distinguish between a function taking a tup

Re: [Felix-language] New ctor syntax

2007-09-18 Thread Erick Tryzelaar
On 9/18/07, skaller <[EMAIL PROTECTED]> wrote: > > What if we did that? Can we parse X (a=5, b=6)? I think C# and java > > are adding that syntax. > > I don't know .. only one way to find out... :) > > More precisely, can we parse: > > (a=1, b=2) // anonymous struct = record > > Then we cou

Re: [Felix-language] New ctor syntax

2007-09-18 Thread skaller
On Tue, 2007-09-18 at 14:09 -0700, Erick Tryzelaar wrote: > On 9/18/07, skaller <[EMAIL PROTECTED]> wrote: > > BTW: I think SML has records but not really tuples, instead > > > > a.member // named component > > a.1 // actually 1 is just the name > > > > so that > > > > (

Re: [Felix-language] New ctor syntax

2007-09-18 Thread Erick Tryzelaar
On 9/18/07, skaller <[EMAIL PROTECTED]> wrote: > BTW: I think SML has records but not really tuples, instead > > a.member // named component > a.1 // actually 1 is just the name > > so that > > (1,2,3) > > is just shorthand for > > (.1=1, .2=2, .3=3) What if we

Re: [Felix-language] New ctor syntax

2007-09-18 Thread skaller
On Tue, 2007-09-18 at 13:23 -0700, Erick Tryzelaar wrote: > On 9/18/07, skaller <[EMAIL PROTECTED]> wrote: > > you can see the parser is using it .. :) > > Hey! that's cheatin! For my next trick .. it would be nice if you could do struct X { int a; int b; }; val x = X { a=1; b=2;

Re: [Felix-language] New ctor syntax

2007-09-18 Thread Erick Tryzelaar
On 9/18/07, Erick Tryzelaar <[EMAIL PROTECTED]> wrote: > I like that. _ctor_int was useful but this should be more clear to new folks. btw, have you removed support for the _ctor_int magic? - This SF.net email is sponsored b

Re: [Felix-language] New ctor syntax

2007-09-18 Thread Erick Tryzelaar
On 9/18/07, skaller <[EMAIL PROTECTED]> wrote: > you can see the parser is using it .. :) Hey! that's cheatin! - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2005. http://clk.at

Re: [Felix-language] New ctor syntax

2007-09-18 Thread skaller
On Tue, 2007-09-18 at 13:05 -0700, Erick Tryzelaar wrote: > On 9/18/07, Erick Tryzelaar <[EMAIL PROTECTED]> wrote: > > I like that. _ctor_int was useful but this should be more clear to new > > folks. > > > btw, have you removed support for the _ctor_int magic? On the contrary: sctor_definit

Re: [Felix-language] New ctor syntax

2007-09-18 Thread Erick Tryzelaar
I like that. _ctor_int was useful but this should be more clear to new folks. - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2005. http://clk.atdmt.com/MRT/go/vse012070mrt/di