Any news on multimethods?

Pragma ericanderton at yahoo.removeme.com
Mon Oct 16 10:29:30 PDT 2006


Jari-Matti Mäkelä wrote:
> Bruno Medeiros wrote:
>> Jari-Matti Mäkelä wrote:
>>> About 1,5 year ago there was short discussion about native multimethods
>>> in D on the NG. Well, is there any possibility to make them native on
>>> the language level. It's a bit annoying to use them via external
>>> libraries.
>> What's wrong with the library approach?
> 
> Well, nothing in particular. It's just a bit more illustrative to use a
> syntax like
> 
>   void method(foo @ bar) { .. }
> 
> and support multimethods on the language level without extra 3rd party
> wrappers. Of course it adds more bloat in general, but I don't really
> know what D is trying to be now. It's too heavy to be a system
> programming language (out of the box) and it lacks many high level
> features that are needed in large scale software projects. Double
> dispatch is a very primitive feature and multimethods are one possible
> way to implement it.
> 
>> (and what multimethods library
>> are you using?)
> 
> I was testing the old hack by Pragma. There was a newer version of it
> somewhere but my newsreader was not able to open it.

That old thing?  Template coding has grown by leaps and bounds since, 
and I'm sure there's a better version in the wild somewhere.

There was also a discussion recently regarding "template varargs" or 
something similar for D.  A feature like that would making writing a 
template multimethod library a piece of cake.  IMO, having that support 
would almost be a fair trade-off for formal multimethods.

-- 
- EricAnderton at yahoo



More information about the Digitalmars-d mailing list