Login  Register

Re: Hard crash when teaching

Posted by jfabry on Oct 07, 2010; 9:59pm
URL: https://forum.world.st/Hard-crash-when-teaching-tp2967507p2967617.html


On 07 Oct 2010, at 17:04, Igor Stasenko wrote:

> 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.

Well, I was not going to use the image for anything else after that ;-)

> 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 ..

Ok I guess that my concept of a hard crash is a bit softer than yours.

> the culprit is in ImageMorph>>image:
> while somehow relying on correct behavior of Integer>>+

The question is why is laying out doing this with non-integers? Screens work with pixels so I did not expect that. You are right that I had to have thought about coercion of others, but I did not expect that to happen at that point... Next time I will be more careful ...

--
Johan Fabry  
[hidden email] - http://dcc.uchile.cl/~jfabry
PLEIAD Lab - Computer Science Department (DCC) - University of Chile




_______________________________________________
Pharo-users mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-users