On Mar 2, 2010, at 8:47 PM, Henrik Sperre Johansen wrote:
On 02.03.2010 14:26, Stéphane Ducasse wrote:
Hi guys
We just released a new chapter for Pharo by Example Vol.2 on Exceptions http://pharobyexample.org/
Let us know what you think.
Stef On p4 there's an error, it says ensure: and ifCurtailed are implemented as primitives, in fact they use the exact same implementation as described of the exception handling in 15.1, the primitive is only used as a marker, and the primitive is required to fail for them to work :)
Yes this is more precise
In addition, I'm not too sure what sense it makes to show how to implement one with the other (nor that the implementations are actually correct, f.ex. ifCurtailed: block does not trigger on non-local returns...)
I would be curious to see if your code is working in GNU Smalltalk.
Other than that, very nice chapter! Especially liked 1.9 - 1.13, with the thorough explanation of the different ways an exception can be returned from.
Cheers, Henry
PS. For the not-so-faint-of-heart, open a Transcript and try evaluating: |proc| proc := [[Transcript show: 'Start!'. ] ensure: [Transcript show: 'Finish!' Processor yield.]] newProcess. proc resume. Processor yield. proc suspend. proc terminate.
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project