[squeak-dev] How do I replace a call SmalltalkImage>>associationAt:ifAbsent:? (Environments)

H. Hirzel hannes.hirzel at gmail.com
Mon Oct 9 10:02:03 UTC 2017


Hello

How do I replace a call SmalltalkImage>>associationAt:ifAbsent:?

ScriptEncoder>>associationForClass
	| assoc |
	assoc := self environment associationAt: cue getClass name ifAbsent: [nil].
	^assoc value == cue getClass
		ifTrue: [assoc]
		ifFalse: [Association new value: cue getClass]



SmalltalkImage>>associationAt: key ifAbsent: aBlock
	"Obsoleted."

	self deprecated: 'Use Smalltalk globals'.
	^globals associationAt: key ifAbsent: aBlock


A direct replacement does not work.


Kind regards

Hannes


More information about the Squeak-dev mailing list