Alexander Burger wrote:
> Hi Cle,

Hi Alex,

>>> (dm foos> () (mapcar cdr (val (: Foos))) )
>> ..
>> Howevery only if the receiver is the class. If I use an instance
>> as receiver, it would not work! I would like to code the method the
>> way, that the method will work regardless if the receiver is a
>> class or one of its instances; like it works in Smalltalk, C++,
>> Java, Ruby ...
>
> This is rather straightforward:
>
> (dm foos> () (mapcar cdr (val (or (: Foos) (var: Foos)))) )

Cool! This is nearly perfect :-) Really nice! Thank you :-)))

(...)

> With this solution we still avoid hard-coding the class into the
> method, which would give problems, for example, if the 'foos>' method
> were inherited by a subclass.

Superb! :-)

My real class is now working nicely without hard coding the class' name
within a method due to your hints. :-)

And I have learned a bit more ...

> Cheers, - Alex

Ciao,
cle.
-- 
UNSUBSCRIBE: mailto:picol...@software-lab.de?subject=unsubscribe

Reply via email to