Am 08.04.19 um 14:39 schrieb Richard O'Keefe:
>
> It's easy enough to add your own methods like
> on: exn1 do: act1 on: exn2 do: act2
> "An imperfect emulation of VAST's #when:do:when:do:"
> ^[self on: exn1 do: act1] on: exn2 do: act2
>
> on: exn1 do: act1 on: exn2 do: act2 on: exn3 do: act3
> "An imperfect emulation of VAST's #when:do:when:do:when:do:"
> ^[[self on: exn1 do: act1] on: exn2 do: act2] on: exn3 do: act3
> to BlockClosure. It won't be fast, but your code might be
> clearer.
well, an unwanted side effect might be that the handling of exn1 is also
guarded by the outer on:do: .
Not that this has to be a problem but it introduces new things to think
about when you want to #resignalAs: and such.
--
-----------------------------------------------------------------------
Objektfabrik Joachim Tuchel mailto:jtuc...@objektfabrik.de
Fliederweg 1 http://www.objektfabrik.de
D-71640 Ludwigsburg http://joachimtuchel.wordpress.com
Telefon: +49 7141 56 10 86 0 Fax: +49 7141 56 10 86 1