[squeak-dev] odd bug in Squeak 4.3, also in Pharo 1.3?...

Lawson English lenglish5 at cox.net
Fri Mar 2 23:28:49 UTC 2012


This code runs with no errors on both images:

myNav := SystemNavigation default.
(myNav allMethodsWithSourceString: '"' matchCase: false) do:
     [:each| each methodSymbol = #Comment
         ifTrue: ["handle true case later"]
         ifFalse: [Transcript show: each asString -> ( each  actualClass 
commentsIn: each sourceString);cr ]]

but this line only works in Squeak 4.3: ifFalse: [Transcript show: each 
asString, '=>', ( each  actualClass commentsIn: each sourceString);cr ]]


Interesting divergence in the code there.


Lawson


On 3/2/12 3:52 PM, Nicolas Cellier wrote:
> Ah sorry, I missed one part of your report (and no, I did not have an
> image handy).
>
> My answer was more for Pharo since you cannot concatenate
>      'foo' , Object new
> You need to use explicitely asString or printString or storeString or...
>      'foo' , Object new asString
>
> Then, the #Comment failure sounds wrong indeed.
> That's just because allMethodsWithSourceString: also scan class comments...
> And this is hackish because:
> - the class comment is not a method, so allMethodsWithSourceString: is
> quite a surprising behavior-name mismatch
> - the least we should do would be to return a ClassCommentReference
> rather than a MethodReference if we want to maintain this feature.
>
> Nicolas
>
>
> Le 2 mars 2012 21:57, Lawson English<lenglish5 at cox.net>  a écrit :
>> On 3/2/12 5:55 AM, Nicolas Cellier wrote:
>>> Transcript print: ... ; cr; endEntry
>> myNav := SystemNavigation default.
>> (myNav allMethodsWithSourceString: '"' matchCase: false) do:
>>     [:each| Transcript show: each asString ->  ( each  actualClass
>> commentsIn: each sourceString);cr;endEntry ]
>>
>> Still generates the error MNU: ComentReference>>sourceString
>>
>> On Pharo 1.3
>>
>> Still generates the error: MNU: Key not found: Comment
>>
>> On Squeak 4.3
>>
>>
>>
>> AFTER many hundreds of lines of valid output.
>>
>> In the same place as before in both images with 2 different VMs.
>>
>>
>>
>> Are you testing the code you are writing and not seeing the error?
>>
>> L
>>
>



More information about the Squeak-dev mailing list