[Cuis-dev] Preference>>accept: visitor is gone
Hilaire Fernandes
hilaire at drgeo.eu
Sat Jul 9 02:00:46 PDT 2022
Hi Juan,
Since your update 5355 the accept: visitor is gone from the Preference
class.
Although not used in the core image, it is needed to visit Preference in
third party application. I copy and paste it below so you merge it back:
Preference>>accept: aVisitor
| visitMethod |
self isTypeAClass
ifTrue: [ visitMethod _ ('visit', type name, 'Preference:')
asSymbol ]
ifFalse: [visitMethod _ ('visit', type species asString,
'Preference:') asSymbol ].
^ aVisitor perform: visitMethod with: self
Also I noted your edit of the type method:
Preference>>type
(type inheritsFrom: CharacterSequence) ifTrue: [ type _
CharacterSequence ].
^ type
It breaks the Preference behavior in DrGeo with my dedicated type
objects (DrGTypeArrow, DrGTypePointShape, etc.), all subclasses of an
Object. Indeed #inheritsFrom: is defined in Behavior not in Object.
I am wondering if it is needed because we all detect type?
Preference>>detectType: anObject
"When the type is not provided, we can try to deduce it "
(anObject isKindOf: CharacterSequence) ifTrue: [ ^CharacterSequence ].
^ anObject class name
caseOf: {
[#True] -> [Boolean].
[#False] -> [Boolean].
[#StrikeFont] -> [AbstractFont].
[#TrueTypeFont ] -> [AbstractFont]
}
otherwise: [anObject class]
I understand these changes are related to your utf-8 work in progress.
Best
Hilaire
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20220709/48c4292c/attachment.htm>
More information about the Cuis-dev
mailing list