[squeak-dev] Order of evaluation bug with in lined to:do: in both Opal and Squeak compilers.
Nicolas Cellier
nicolas.cellier.aka.nice at gmail.com
Fri Apr 21 22:05:02 UTC 2017
2017-04-21 23:05 GMT+02:00 Nicolas Cellier <
nicolas.cellier.aka.nice at gmail.com>:
> I see more than 1000 senders but most of them are in the style 1 to: ...
> If any of receiver or 1st arg is a LiteralNode, no need to analyze, so it
> should be possible to write a small analyzer to select non trivial cases
> and review manually. Something like:
>
> SystemNavigation default
> browseMessageList: ((SystemNavigation default allCallsOn: #to:do:)
> select: [:e |
> | ast found |
> ast := e actualClass newParser parse: e sourceCode class: e
> actualClass.
> found := nil.
> ast accept: (ParseNodeEnumerator
> ofBlock: [:node | ((node isKindOf: MessageNode)
> and: [node selector key = #to:do:
> and: [node receiver isLiteralNode not
> and: [node arguments first isLiteralNode not]]])
> ifTrue: [found := node]]).
> found notNil])
> name: 'complex senders of to:do:'
> autoSelect: true.
>
> Above script did not find any complex senders though I see some, so I must
> have screwed something, but you get the idea.
>
> Then there is the case of to:by:do: to analyze too.
>
>
Ah, my script failed because to:do: is transformed at this stage (disguised
in #to:by:do:)...
SystemNavigation default
browseMessageList: ((SystemNavigation default allCallsOn: #to:do:)
select: [:e |
| ast found |
ast := e actualClass newParser parse: e sourceCode class: e
actualClass.
found := nil.
ast accept: (ParseNodeEnumerator
ofBlock: [:node | ((node isKindOf: MessageNode)
and: [(node selector key = #to:do: or: [node selector
key = #to:by:do: ])
and: [node receiver isLiteralNode not
and: [node arguments first isLiteralNode not]]])
ifTrue: [found := node]]).
found notNil])
name: 'complex senders of to:do:'
autoSelect: #to:do:
But I can't test other trivial cases when node arguments first
isVariableNode, because it allways is after transform.
It would be necessary to disable transform during analysis...
> 2017-04-21 16:08 GMT+02:00 Bert Freudenberg <bert at freudenbergs.de>:
>
>> On Fri, Apr 21, 2017 at 1:56 AM, Eliot Miranda <eliot.miranda at gmail.com>
>> wrote:
>>
>>> On the order of evaluation bug, does anyone have any memory of which
>>> methods depended on this bug?
>>>
>>
>> No idea ...
>>
>> - Bert -
>>
>>
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20170422/3444bff2/attachment.html>
More information about the Squeak-dev
mailing list
|