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

Re: Q: member syntax in dylan?




"Rob Myers" <robmyers@mac.com> wrote in message
news:200105101013.GAA27213@life.ai.mit.edu...
> On Thursday, May 10, 2001, at 10:45  am, Roland Paterson-Jones wrote:

> >         e.g. obj . m ( o1 , o2 , o3 , o4 )
> This means "call the return of calling m on n with (o1, o2, o3, o4)".

OK, understood. Is there any way in dylan of achieving the required
semantics with this or some similar syntax?

The motivation is, of course, that it's fun to associate methods with their
class, particularly when their are no multi-dispatch issues. I believe that
this encourages object-oriented programming (having come, of course, from
java and c++).

>   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.

Can you give an example where a call is dispatched elsewhere and the first
argument is (exactly) a <class>. I can think of such examples where the
first argument is a  proper subclass of <class>. Actually, I can probably
think of one where dispatch is performed on at least 2 other arguments, but
this is pretty contrived and such would certainly not want to use this sort
of syntactic sugar.

I have the feeling that, most of the time, methods I write would be (in
effect) single-dispatched on one (the first) argument.

Roland





Follow-Ups: