[Squeakfoundation]RE: [FIX] MoreWeakMsgSendFixes-nk
Withers, Robert
squeakfoundation@lists.squeakfoundation.org
Mon, 30 Dec 2002 10:39:43 -0500
This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.
------_=_NextPart_000_01C2B019.AC8E19A0
Content-Type: text/plain;
charset="iso-8859-1"
Ned,
I just got back from xmas break this weekend, so I wasn't able to answer,
earlier. I loaded it and looked at the code. This looks fine to me. I
recategorized three registration methods, <nitpik/> and republished your
changeset, attached here.
It would be nice to keep the action map minimal, as actions commit
hari-kari, due to weak references disappearing. Currently only a
re-registration will minimize the stored sequence. This should prolly be a
3.5 activity.
cheers,
rob
> -----Original Message-----
> From: Ned Konz [mailto:ned@bike-nomad.com]
> Sent: Friday, December 20, 2002 9:07 PM
> To: squeakfoundation@lists.squeakfoundation.org
> Cc: Withers, Robert
> Subject: Re: [FIX] MoreWeakMsgSendFixes-nk
>
>
> I've just posted [FIX] MoreWeakMsgSendFixes-nk to the squeak-dev list.
>
> This needs to go into 3.4beta, since if you have an older action map
> (with a MessageSend or an ActionSequence in it), a triggerEvent: will
> cause a DNU.
>
> Apparently this was broken in CS 5005, and no one noticed it until
> now.
>
> On the Squeak-dev list, Martin Drautzburg reported:
> -----------
> MessageNotUnterstood: isReceiverOrAnyArgumentGa[rbage] (I cannot see
> all of it)
>
> ActionSequence(Object)>>doesNotUnderstand
> PasteUpMorph(Object)>>actionForEvent:
> PasteUpMorph(Object)>>triggerEvent:
> PasteUpMorph class >> shutDown
> PasteUpMorph class (Behavior)>>shutDown:
> -----------
>
> Could someone look at the [FIX], please?
>
> Rob, does it look OK?
>
> Thanks,
> --
> Ned Konz
> http://bike-nomad.com
> GPG key ID: BEEA7EFE
>
------_=_NextPart_000_01C2B019.AC8E19A0
Content-Type: application/octet-stream;
name="MoreWeakMsgSendFixes-nk-rww.2.cs"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment;
filename="MoreWeakMsgSendFixes-nk-rww.2.cs"
'From Squeak3.4beta of ''1 December 2002'' [latest update: #5156] on 30 =
December 2002 at 10:37:45 am'!=0D"Change Set: =
MoreWeakMsgSendFixes-nk=0DDate: 20 December 2002=0DAuthor: Ned =
Konz=0D=0DCS 5005u16-Events introduced a call to a method =
isReceiverOrAnyArgumentGarbage in Object>>actionSequence that was only =
understood (much later, after CS 5155WeakMessageSend2-nk-rw) by =
WeakMessageSends and WeakActionSequences.=0D=0DUnfortunately, if you =
had an ActionSequence or a MessageSend around in an action map, this =
would break, as they don't understand =
isReceiverOrAnyArgumentGarbage.=0D=0DI removed this call from the =
methods in Object so that any action maps that can answer =
asMinimalRepresentation will work.=0D=0DThis =
includes:=0DActionSequence, WeakActionSequence, MessageSend (added), =
and WeakMessageSend.=0D"!=0D=0D=0D!Object methodsFor: =
'events-accessing' stamp: 'nk 12/20/2002 17:48'!=0DactionForEvent: =
anEventSelector=0D "Answer the action to be evaluated when =
<anEventSelector> has been triggered."=0D=0D | actions |=0D actions =
:=3D self actionMap=0D at: anEventSelector asSymbol=0D ifAbsent: =
[nil].=0D actions ifNil: [^nil].=0D ^ actions =
asMinimalRepresentation.=0D! !=0D=0D!Object methodsFor: =
'events-accessing' stamp: 'nk 12/20/2002 17:48'!=0DactionForEvent: =
anEventSelector=0DifAbsent: anExceptionBlock=0D "Answer the action =
to be evaluated when <anEventSelector> has been triggered."=0D=0D | =
actions |=0D actions :=3D self actionMap=0D at: anEventSelector =
asSymbol=0D ifAbsent: [nil].=0D actions ifNil: [^anExceptionBlock =
value].=0D ^ actions asMinimalRepresentation.=0D! !=0D=0D!Object =
methodsFor: 'events-registering' stamp: 'rww 12/30/2002 10:37'!=0Dwhen: =
anEventSelector=0Dsend: aMessageSelector=0Dto: anObject=0D =0D self=0D =
when: anEventSelector=0D evaluate: (WeakMessageSend=0D =
receiver: anObject=0D selector: aMessageSelector)! =
!=0D=0D!Object methodsFor: 'events-registering' stamp: 'rww 12/30/2002 =
10:37'!=0Dwhen: anEventSelector=0Dsend: aMessageSelector=0Dto: =
anObject=0Dwith: anArg=0D =0D self=0D when: anEventSelector=0D =
evaluate: (WeakMessageSend=0D receiver: anObject=0D =
selector: aMessageSelector=0D arguments: (Array with: =
anArg))! !=0D=0D!Object methodsFor: 'events-registering' stamp: 'rww =
12/30/2002 10:37'!=0Dwhen: anEventSelector=0Dsend: =
aMessageSelector=0Dto: anObject=0DwithArguments: anArgArray=0D =0D =
self=0D when: anEventSelector=0D evaluate: =
(WeakMessageSend=0D receiver: anObject=0D =
selector: aMessageSelector=0D arguments: anArgArray)! =
!=0D=0D=0D!MessageSend methodsFor: 'converting' stamp: 'nk 12/20/2002 =
17:54'!=0DasMinimalRepresentation=0D ^self! =
!=0D=0D=0D!WeakActionSequence methodsFor: 'converting' stamp: 'nk =
12/20/2002 17:45'!=0DasMinimalRepresentation=0D=0D | valid |=0D valid =
:=3D self reject: [:e | e isReceiverOrAnyArgumentGarbage ].=0D valid =
size =3D 0=0D ifTrue: [^nil].=0D valid size =3D 1=0D ifTrue: [^valid =
first].=0D ^valid! !=0D=0D!WeakActionSequence methodsFor: 'evaluating' =
stamp: 'nk 12/20/2002 17:44'!=0Dvalue=0D "Answer the result of =
evaluating the elements of the receiver.=0D Actually, return just the =
last result."=0D=0D | answer |=0D self do:=0D [:each |=0D =
each isReceiverOrAnyArgumentGarbage =0D ifFalse: [answer :=3D each =
value]].=0D ^answer! !=0D=0D!WeakActionSequence methodsFor: =
'evaluating' stamp: 'nk 12/20/2002 17:44'!=0DvalueWithArguments: =
anArray=0D=0D "Return the last result"=0D=0D | answer |=0D self =
do:=0D [:each |=0D each isReceiverOrAnyArgumentGarbage =0D =
ifFalse: [answer :=3D each valueWithArguments: anArray]].=0D =
^answer=0D! !=0D=0D!WeakActionSequence methodsFor: 'testing' stamp: 'nk =
12/20/2002 17:43'!=0DisReceiverOrAnyArgumentGarbage =0D=0D ^self =
anySatisfy: [ :element | element isReceiverOrAnyArgumentGarbage ]! !=0D
------_=_NextPart_000_01C2B019.AC8E19A0--