From: Bob Hutchison Date: 2005-12-23T23:34:47+09:00 Subject: Re: Diff of opinion on dynamic stuff On Dec 23, 2005, at 12:47 AM, Isaac Gouy wrote: > Yes, the equivalent of "method_missing" has been used for many things > in Smalltalk. Glorifying in how we can hack "doesNotUnderstand:" > avoids having to admit that there's been a problem with the language. The problem being: in Smalltalk the language there is no explicit way in the language to add a method to a class at runtime? Maybe so, but the Smalltalk *environment* allows the programmer to do exactly the same thing as the browser or debugger at runtime (though only on a class level). In some implementations, there is a method that changes an object's class, and that combined with the ability to create a new class at runtime... (well, this is hard to manage, and some implementations will, effectively, only redefine the parent class of an object). This excessive use/dependency on doesNotUnderstand is not necessary in Smalltalk. Isn't re-opening a class very similar to some of the better methods in the paper below? At the very least, the associated problems are similar :-) What are the Python folks doing as an alternative? > > "This comparison highlights that the most commonly used technique > based > on the specialization of the doesNotUnderstand: method is not the best > one. As a first explanation of this situation, one should note that > the > ability to directly execute a method has only lately been > introduced in > the interpreters (methods valueWithReceiver:arguments: on > CompiledMethod class in VisualWorks and > executeWithReceiver:andArguments: in IBM Smalltalk). Moreover, this > comparison shows that the techniques based on VM lookup method or > method wrappers should be considered by more programmers than it is > currently the case." > > "Evaluating Message Passing Control Techniques in Smalltalk" > http://www.iam.unibe.ch/~scg/Archive/Papers/ > Duca99aMsgPassingControl.pdf ---- Bob Hutchison -- blogs at Recursive Design Inc. -- Raconteur --