[squeak-dev] About on:do:

Lukas Renggli renggli at gmail.com
Mon Jul 21 10:46:15 UTC 2008


>  on: exception do: handlerAction
>         "Evaluate the receiver in the scope of an exception handler."
>
>         | handlerActive |
>         <primitive: 199>  "just a marker, fail and execute the following"
>         handlerActive _ true.
>         ^ self value

199 is a primitive that marks the context (it just sets a bit in the
context object) and always fails. The fallback code is then evaluated
that causes the receiving block to evaluate. That's all.

In case of an exception the VM can quickly find marked contexts.

Cheers,
Lukas

-- 
Lukas Renggli
http://www.lukas-renggli.ch



More information about the Squeak-dev mailing list