Allen Short <[EMAIL PROTECTED]> writes: > >>>>> "Peter" == Peter Seibel <[EMAIL PROTECTED]> writes: > > > > Hi, I'm new to this list and haven't had a chance to grovel > > through the old archives yet so please forgive me for jumping in > > in the middle of things. > > > Anyway, what about languages that don't attach methods to > > particular classes--languages that support generic functions and > > multimethods (i.e. a method is dispatched at runtime based on > > the type of more than one of its arguments.) I ask because I > > started looking at Parrot (and joined this list) because I was > > interested in the idea of writing a Common Lisp that runs on > > Parrot. I had looked at the CLR as a possible target and found > > it too tied to the single-dispatch model of methods "belonging" > > to particular classes. I was hoping things would be more > > flexible here. Was I hoping for too much? > > I'd expect defmethod/defgeneric to generate instances of a > "standard-generic-function" and "standard-method" class, which holds > the code and specializations, and whose methods implement CL-style > dispatch; this would make for a convenient MOP, as well as providing > some chance for interfacing with modules in other languages.
So if I did that (and it makes sense) what are the chances that the JIT would be able to do anything smart in the case where all the methods defined on a generic function happen to be single dispatch? I'm assuming that the code to do fully general CL-style dispatching is going to be slower than the "native" single dispatch; in the case where all the methods *are* in fact single dispatch, I'd like to compile them to the "native" single dispatch rather than going through a bunch of generalized machinery. Again, apologies if this is all out of nowhere and ignorant to boot--I've just recently started looking at Parrot. -Peter -- Peter Seibel [EMAIL PROTECTED] The intellectual level needed for system design is in general grossly underestimated. I am convinced more than ever that this type of work is very difficult and that every effort to do it with other than the best people is doomed to either failure or moderate success at enormous expense. --Edsger Dijkstra