" On 24/11/1998, Dan Ingalls wrote: Hi, guys - Well it's not the best from TerseMan, but I claim that this do-it will write all the code that you need to run MathMorphs in 2.3.  What it does is to write a version of adaptToType:andSend: that calls your existing conversion methods, for all cases where they are implemented. To try it out, I filedIn 'Groups.cs', and then executed this code.  Then it was possible to execute          3.0 i + 4 and          4 + 3.0 i which did not work before. It might be useful to you, but I think a compatibility fileIn would actually be better, since it would bring everything into conformity with the new scheme, thus leaving it simple and consistent.  For instance Complex would only have 3 or 4 conversion methods plus a couple more to work with collections and points if desirable. Anyway, I thought you might find this amusing...          - Dan --------------------------------------------- " | adaptSels className classSymbol | Smalltalk allClassesDo:      [:cl |      adaptSels _ cl selectors select: [:sel | sel beginsWith: 'adaptTo'].      adaptSels do:           [:sel |           (sel endsWith: ':') ifFalse:                [className _ sel copyFrom: 8 to: sel size.                ((Symbol hasInterned: className                     ifTrue: [:sym | classSymbol _ sym])                     and: [Smalltalk includesKey: classSymbol]) ifTrue:                     ["Found a selector like adaptToComplex"                     (cl includesSelector: ('adapt' , className , ':') asSymbol)                          ifTrue:                          ["OK -- also have, eg, adaptComplex:"                          cl compile: ( 'adaptTo&type: rcvr andSend: selector      "If I am involved in arithmetic with a &type.      Convert us and resend the message selector."      ^ (self adapt&type: rcvr) perform: selector with: (self adaptTo&type)'                                    copyReplaceAll: '&type' with: className)                               classified: 'converting' notifying: nil.                          ]]]]]