On Sep 9, 2:36 am, ntupel <[EMAIL PROTECTED]> wrote:
> On Mon, 2008-09-08 at 13:15 -0700, Rich Hickey wrote:
> > Hmm, don't do that?
>
> > Seriously, how is this a bug in Clojure, and not a bug in your
> > program, which resulted in an exception which easily leads you to your
> > problem?
>
> Well, first of all this bug in a users program results in undefined
> behavior in the Clojure compiler which terminates due to a resource
> exhaustion without any particular error message. This should never
> happen.
>
> Then, please note that this somewhat contrived example, when extended to
> circular requires, e.g. A requires B and B requires A might accidentally
> (or by bad design) occur during development. One can argue whether this
> should result in an error message or whether the semantics of require
> are satisfied if the namespaces are loaded once each. But again, a
> StackOverflowError and a "don't do that" can not be the answer.
>

It doesn't feel terribly much different to me from:

(defn foo [] (foo))

My point is, having encountered this error (which is not the kind of
thing that is going to lurk around to bite you deep at runtime), was
it not obvious what the problem was? Did Clojure, and the work you
were doing, vanish? It may not have been the one you want, but you got
an error and a place in the code to look.

Certainly there are areas where there could be more explicit messages,
but the detection and reporting of errors has a cost (in time,
sometimes runtime, effort, code size and complexity) and I don't want
to incur that cost unless it is solving a real, common problem, not
just a theoretical one.

Rich

--~--~---------~--~----~------------~-------~--~----~
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
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/clojure?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to