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

Re: s-exprs + prototypes




On Saturday, June 21, 2003, at 02:07 PM, Michael Vanier wrote:
>
>> So the difference is simply one of notational
>> convenience. I find it more notationally convenient to use the same
>> name for the same operation on different types and to be able to 
>> define
>> that operation for new types later so that old code works on new 
>> types.
>> Otherwise you have to use list-length and vector-length and
>> string-length instead of just length.
>
> But if you feel like this, then the "most general" system is like that 
> in
> CLOS or GOO, where you can dispatch on many types, not just on one.  
> The
> limitations of single dispatch OO are well known.

My syntax doesn't prevent that. Even in languages with multiple 
dispatch, the overwhelming majority of the methods are still single 
dispatch and the overwhelming majority of the multiple dispatch cases 
are double dispatch (ref some paper on Cecil). (receiver selector 
argument) syntax works very well for double dispatch, take + and * for 
example. And it is not any worse for >2 multiple dispatch cases.

>   Maybe "more general" was
> the wrong choice of words.  "More basic" might be more like it.

Refer to my post about objects being functions.
Objects are functions that take a selector as an argument.
Functions are objects that have only one selector: 'apply'.
I don't see one as more basic than another, but I can implement the 
second much more easily if I have the first than vice versa.

Lisp does lock you in. It locks you into a world where you have to 
implement an object system if you want one (different than CLOS) and 
when you do, you still have these things in it that are not objects.

Smug Lisp Weenies: we've taken your lambdas and now we're taking your 
s-exprs and macros. Soon there will be no leg to stand on.

-- 
--- james mccartney   james@audiosynth.com   <http://www.audiosynth.com>
SuperCollider - a real time audio synthesis programming language for 
MacOS X.