<br><br><div class="gmail_quote">On Mon, Mar 23, 2009 at 9:00 PM, Michael van der Gulik <span dir="ltr"><<a href="mailto:mikevdg@gmail.com">mikevdg@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br><div class="gmail_quote"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">2009/3/24 Vaidotas Didžbalis <span dir="ltr"><<a href="mailto:vaidasd@gmail.com" target="_blank">vaidasd@gmail.com</a>></span><div class="im">
<br>Thank you,<br>
I have question about style:<br>
in the code I see:<br>
<br>
boolean ifFalse:[^self error: 'Some error'].<br>
<br>
sould'nt it be like this:<br>
<br>
boolean ifFalse:[self error: 'Some error'].<br>
<br>
Since “self error:" is definitely expected to signal exception?<br>
<br>
</div></blockquote></div><br><br>You can validly continue execution from an error (unlike, for example, Java). Sometimes, I'd get an error, fix things up in the debugger and then continue execution.</blockquote><div>
<br>Yes, Vaidotas, take a look at Exception>>isResumable. It's overridden on Error to return false but can be overridden again by subclasses.<br><br>As long as an Exception is resumable, you can do the following:<br>
<br>[self doSomething]<br> on: SomeError<br> do: [ :error | error resume: 5 ]<br></div></div><br>And if I recall correctly the ANSI standard specifies that behaviour is undefined when resuming a non-resumable Exception (!) so in some cases you can do that too! :)<br>
<br>Julian<br>