[Prev][Next][Index][Thread]
Re: Q: member syntax in dylan?
On Thu, 10 May 2001 05:45:01 -0400 (EDT), "Roland Paterson-Jones"
<rolandpj@bigfoot.com> 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 )
Actually it has been argued that the equivalent syntax in Dylan ought to
be:
( o0, o1, o2, o3, o4 ) . m
to highlight that the other arguments are not processed differently from
the first.
I don't think there is any intrinsic reason although there may be technical
issues in the lexing or parsing.
> 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
>
> instead of
>
> define method m1 ( <class> this , a1 , a2 ) ... end
>
> Please forgive all errors, I'm just starting to look at dylan for the first
> time.
Again there is no intrinsic reason. In fact you might be able to write a
macro to do this although it might end up looking more like:
define protocol ( this :: <foo>, that :: <quux> )
define method bar ( a1 :: <bar> ) ... end;
define method baz ( a2 :: <baz> ) ... end;
...
end;
so that it expanded into:
define method bar ( this :: <foo>, that :: <quux> , a1 :: <bar> ) ... end;
define method baz ( this :: <foo>, that :: <quux> , a2 :: <baz> ) ... end;
..
__Jason
References: