-------- Doorgestuurd bericht --------
Hello, Noury,
Thanks for letting me see this but I wonder if it is good
practice to place my own methods on the Object and
UndefinedObject ?
Roelof
Op 13-9-2020 om 14:51 schreef Noury Bouraqadi:
Hi Roelof,
Polymorphism is the answer.
Object >> flattenInto: result
result
nextPut: anObject
UndefinedObject >> flattenInto: result
^self
Collection >> flattenInto: result
self
do: [ :item | item flattenInto: result ]
flatten: anObject
^ (OrderedCollection streamContents: [
:stream | anObject flattenInto: stream ]) asArray
Noury