On Fri, Jan 27, 2012 at 5:38 PM, philip k <trevo.pa...@gmail.com> wrote:

> I'm not so sure about this, but is it possible to throw an exception
> when dividing by zero for example? I don't know if exceptions are the
> right way of dealing with this at all, but at least this would be
> bringing things more in line with Clojure.
>

divide by zero (introduces Infinity) and arithmetic on non-numbers
(introduces NaN) both throw in the checked-arithmetic branch. I personally
think exceptions are the way to deal with this as it pinpoints the source
of the error quickly without letting bad arithmetic continue on Infinity
and NaN. In my experience it's very tedious to debug.

Open to hearing why you think the JavaScript behavior is a good one!

David

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Reply via email to