Posted by
Igor Stasenko on
Oct 07, 2010; 9:04pm
URL: https://forum.world.st/Hard-crash-when-teaching-tp2967507p2967548.html
On 7 October 2010 23:39, Johan Fabry <
[hidden email]> wrote:
> Always fun when you want to show the students that everything can be changed in Smalltalk ...
> Inclusive the behavior of Integer>>+
> Inclusive when the current behavior does strange things with the second argument when it is not a number (instead of simply throwing an error), e.g what happens in 1 + 'foo'
> Inclusive when you are debugging said expression.
>
> Apparantly that was too much to ask :-( Hard crash of the image :-( :-(
>
> Reported as issue
http://code.google.com/p/pharo/issues/detail?id=3072>
its not very good idea to replace
^ aNumber adaptToInteger: self andSend: #+
with
^ self error: 'boo'
because many parts of system relies on 'silent' type coercion.
I didn't experienced the hard crash in pharo image.
What i got instead, is an error, printed in emergency console
saying that it unable to handle the system error ..
the culprit is in ImageMorph>>image:
while somehow relying on correct behavior of Integer>>+
and ImageMorph obviously used by Morphic rendering.
So, its not crashing. Image is still responsible. You just broken UI with it:
a toolbuilder, when creating a new Error popup window, also creates
and initializing an ImageMorph as a submorph.
And since it fails with error, the error-handling layer treats this as
failure to handle error
and thus, it switching to emergency console.
Btw, there was a good chances, that even an emergency console could be
broken because of such change.
--
Best regards,
Igor Stasenko AKA sig.
_______________________________________________
Pharo-users mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-users