[Prev][Next][Index][Thread]

Re: Q: member syntax in dylan?



On Thursday, May 10, 2001, at 10:45  am, Roland Paterson-Jones wrote:

> Is there any intrinsic reason not to allow 'obj . member' syntax for 
> methods
> with more than one argument in dylan?
>
>         e.g. obj . m ( o1 , o2 , o3 , o4 )

This means "call the return of calling m on n with (o1, o2, o3, o4)". It 
expands to:

let meth = m( obj );
meth( o1, o2, o3, o4 );

> Is there any intrinsic reason against allowing definitions of methods
> closely coupled with class definition?
>
>         e.g. with <class>
>                 define method m1 ( a1 , a2 ) ... end
>             end

  It's a nice construct, but misleading: it gives pression that m1() is 
just dispatching on (<class>) rather than all its arguments. Methods 
aren't owned by objects in Dylan, they're owned by generic functions. 
The closest C++ gets to this is "friend", and Java just can't do it IIRC.

>
> Please forgive all errors, I'm just starting to look at dylan for the 
> first
> time.

No problem. This is the right place for questions. :-)

- Rob.


References: