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

Nicolas Cellier nicolas.cellier.aka.nice at gmail.com
Sat Mar 3 12:14:33 UTC 2012


Le 3 mars 2012 00:04, Lawson English <lenglish5 at cox.net> a écrit :
> Is that a bug fix, or a workaround, I wonder?
>

It's the shortest hack to make your sentence work.
Certainly not a long term scaling solution, because we would have to
spread some more ifTrue: here and there
- in both MethodReference
- and its users.
The former is a way to accomplish poor man polymorphism
The later is a way to have complex code which can't abstract and
delegate, but instead has to be omniscient
See for example MessageSet>>contents:notifying:

I'd say Squeak can tolerate such hack (it's just one more in the image).
But Pharo wouldn't. MethodReference has already been cleaned up in 1.4 ;)

Nicolas

> Regardless, I'll  redo the video but add the caveat that due to an existing
> issue, one needs to add an extra line of code to skip printing out methods
> whose symbol is #Comment.
>
> L.
>
>
> On 3/2/12 3:57 PM, Bob Arning wrote:
>
> If you change
>
> MethodReference>>sourceString so that it looks like this:
>
> sourceString
>
>     self methodSymbol = #Comment ifTrue: [^self actualClass comment].
>     ^ (self actualClass sourceCodeAt: self methodSymbol) asString
>
> your code will run in Squeak 4.2 and presumably 4.3.
>
> Cheers,
> Bob
>
> On 3/2/12 3:57 PM, Lawson English wrote:
>
> 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