[Cuis-dev] PreferenceNG integration in the image
Mariano Montone
marianomontone at gmail.com
Mon May 9 14:12:00 PDT 2022
I think I would append 'Preference' to the method name.
If not, when visiting a Preference of type Boolean, the visitor gets
visitBoolean: , but is not passed a Boolean object, it is passed a
Preference instance. So, I'd prefer: visitBooleanPreference: aPreference
accept: aVisitor
| visitMethod |
self isTypeAClass
ifTrue: [ visitMethod _ ('visit', type name, 'Preference:')
asSymbol ]
ifFalse: [visitMethod _ ('visit', type species, 'Preference:')
asSymbol ].
aVisitor perform: visitMethod with: self! !
That's my preference! (yes, I'm so funny ...)
El 9/5/22 a las 17:06, Hilaire Fernandes via Cuis-dev escribió:
>
> Hi,
>
> Here is an updated version with an accept method for a visitor.
>
> Hilaire
>
> --
> GNU Dr. Geo
> http://drgeo.eu
> http://blog.drgeo.eu
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20220509/5013d78b/attachment.htm>
More information about the Cuis-dev
mailing list