<br><br><div class="gmail_quote">On Tue, Mar 24, 2009 at 10:08 PM, Attila Rajmund Nohl <span dir="ltr"><<a href="mailto:attila.r.nohl@gmail.com">attila.r.nohl@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;">
2009/3/24, Hynek Vychodil <<a href="mailto:vychodil.hynek@gmail.com">vychodil.hynek@gmail.com</a>>:<br>
[...]<br>
<div class="im">><br>
> code<br>
><br>
> ok = is_new_email1(Email).<br>
><br>
> doesn't looks like same amount of code<br>
><br>
> try is_new_email2(Email) catch throw:email_in_use -> email_in_use end.<br>
><br>
> First one turns return value to exception, second one turns exception to<br>
> return value. Second one seems more code, does not?<br>
<br>
</div>The beauty of execption handling is that you don't have to handle the<br>
exception where it was thrown. So in real code the second would be<br>
something like<br>
<br>
checks() -><br>
foo(),<br>
is_new_email(Email),<br>
bar().<br>
<br>
And the catch would be at the call of checks().<br>
</blockquote></div><br>And again, you assume how I will use your function. It's wrong! You avoid me to make case when I know what to do.<br><br>-- <br>--Hynek (Pichi) Vychodil<br><br>Analyze your data in minutes. Share your insights instantly. Thrill your boss. Be a data hero!<br>
Try Good Data now for free: <a href="http://www.gooddata.com">www.gooddata.com</a><br>