[nem-en] Tupled . operator - what do you think?

Michal Moskal michal.moskal at gmail.com
Thu Nov 23 08:41:59 CET 2006


On 11/23/06, Andrey Khropov <andrey.khropov at gmail.com> wrote:
> class Person {
> ...
> public Name : string { set; }
> public Surname : string { set; }
> ...
> }
>
> ...
> def employee = Person(); // for some reason we want to delay initialization
> ...
> employee.(Name,Surname) = ("John","Smith");

It seems to me like a good idea to me. Implementation would probably
involve hacking parser to emit:

  _N_tupled_dot (employee, Name, Surname)

when it sees:

  employee.(Name,Surname)

and then writing a simple macro.

I think we still have some problems with proper caching of value types
(so we'll have hard time getting the example above to work when Person
is a struct), but this is separate issue.

-- 
   Michał


More information about the devel-en mailing list