Clojure Protocols & expression problem

bearophile bearophileHUGS at lycos.com
Wed Apr 28 18:39:41 PDT 2010


Andrei Alexandrescu:

> Good question. Statistically, I'd say very few people are interested in 
> double dispatch.

I see. I'd like to know what CLOS (CLisp) users too think about this.

(Generally if a feature become syntactically clean and nice, and it's written in the manual, surely more people can find the desire to use it. But this is just speculation.)


> If we're to discuss double dispatch, I think we should first look at 
> library solutions and at ways to improve the language to allow general 
> solutions to categories of problems instead of cutesies like @virtual 
> function parameters.

In this case I agree that it's positive to first look for library solutions, and eventually, if seen fitting, think about moving something to the built-in features (see the answer I've written for Lutger).

Regarding the 'cutesies', I am irrevocably spoiled by Python and ShedSkin :-) My work on ShedSkin has shown me once and for all that a fast language and a very nice syntax are not incompatible things.

To give you a more focused answer, it's a matter of design balances. Tidy and specialized solutions are often nicer syntax-wise, and simpler to use. Such tidiness helps average-level programmers find the will to actually use them. Too much general solutions become like Rubik cubes that need a little too much assembly and brain to be used. But they can't be adapted to very different situations, etc. So in designing the language you must be balanced. Python shows that very well designed cutesies too can go a long way.


> Above all, I think at this time we should go with improving the language 
> definition and the quality of the compiler.

You have noticed I have asked this question regarding D3. I agree that now there is enough work to do to produce a working D2 version.

You probably remember that recently I have shown in this newsgroup a list of little/tiny breaking changes (from some of my Bugzilla reports) to be discussed/addressed/fixed that I believe can be useful/necessary to create a good D2 implementation. They are surely more urgent than double dispatch. Despite this, I like to discuss here about all things.

Bye and thank you,
bearophile



More information about the Digitalmars-d mailing list