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

H. Hirzel hannes.hirzel at gmail.com
Mon Oct 9 20:23:07 UTC 2017


Found the use case.

Steps to reproduce it in your Squeak 6.0a trunk image:

a) In a regular MorphicProject choose 'show shared flaps' (right-click
world menu in my setup)
b) from the 'widgets' flap bring out a paint tool
c) draw a sketch / select 'keep'
d) bring up the halos of the sketch
e) choose the blue 'viewer' icon
f) drag out the 'sketch turn by 5' tile from the tiles of the sketch

you get the error message

SmalltalkImage>>#associationAt:ifAbsent: has been deprecated. Use
Smalltalk globals



On 10/9/17, H. Hirzel <hannes.hirzel at gmail.com> wrote:
> Squeak 6.0a trunk image.
> With fix EToys-hjh.308.mcz loaded (please commit it to trunk)
>
> The I dropped an Etoys example pr project file from
>     http://squeakland.org/tutorials/demos/
> onto the desktop.
>
> Unfortunately I do not recall the details which action caused the
> walkback window with the
>
>       SmalltalkImage>>associationAt:ifAbsent:
>
> problem to appear.
>
> I'll report later if it occurs again.
>
> --Hannes
>
> On 10/9/17, Levente Uzonyi <leves at caesar.elte.hu> wrote:
>> On Mon, 9 Oct 2017, H. Hirzel wrote:
>>
>>> Hello
>>>
>>> How do I replace a call SmalltalkImage>>associationAt:ifAbsent:?
>>
>> What image do you use? The receiver of #associationAt:ifAbsent: must not
>> be a SmalltalkImage but an Environment.
>>
>> Levente
>>
>>>
>>> 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
>>
>>
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Squeak6.0a_error_after_dragging_out_a_tile_Screenshot_2017-10-09.png
Type: image/png
Size: 147570 bytes
Desc: not available
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20171009/ab9cdbcc/attachment-0001.png>


More information about the Squeak-dev mailing list