--
You received this message because you are subscribed to the Google Groups "Clojure Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to clojure-dev...@googlegroups.com.
To post to this group, send email to cloju...@googlegroups.com.
Visit this group at http://groups.google.com/group/clojure-dev.
For more options, visit https://groups.google.com/d/optout.
This is already supported through the assert macro, which pre/post conditions expand into. It only expands into code when *assert* is true.
Is there an implementation of the idea that has been published somewhere?
Agreed that something like alter-var-root would probably be a good way to get their pre-conditions in place from a 3rd-party lib.
This is how dynalint works. From communications via Alex Miller, Rich is not interested in this ad-hoc approach. I believe a more integrated debug-mode is more desirable, which he has mentioned at Clojure Conj 2012.
Hi All,
I was very excited to see this discussion! I think it would be great to have the ability to run Clojure with beginner-friendly messages (by using a flag or some such on the user side -- and reader conditionals may be a way to go). Integrating such a mode with clojure.core would make maintenance easier since it would be immediately clear where changes to core affect error messages.
However, there are a couple of things to clarify here:
We are working on transforming/augmenting error messages, but at this point I wouldn’t call it a library, it’s very much an in-development thing with quite a few quirks for historic reasons. The technical side of things would need to be modified. It’s not a huge undertaking, but makes this a bit more fragile than it already is.
The error messages are not tested in a real-life usage on the target audience (which, for us, is learners with no programming background at all). I suspect that for that audience we will need to simplify a few things even from what we now consider quite simple.
Messages that would be ideal for beginners with no programming experience may not (or may -- we just don’t know) be a good fit for Clojure beginners that come from other programming background. It would be really confusing/unwise to be making adjustments reactively (and therefore likely inconsistently) between different versions of Clojure trying to serve both categories of beginners.
Ideally beginner-friendly messages should eventually be incorporated with debugging and refactoring tools. While this is a long road, it’s important not to discover later that error messages and debugging/refactoring tools cannot be easily connected, technically or in terms of terminology/approaches. Macros are one possible source of issues here.
There is also a bigger issue of what error messages in Clojure should be, for all users. Is Clojure committed to Java exceptions? With all the good reasons for this (after all, Clojure errors *are* Java exceptions!), it is an adoption barrier.
In practice, I think for now we will continue with developing an independent wrap-up around clojure.core functions and, hopefully, study its usability in a real-life learning experience. If this looks promising, means of integrating it into clojure.core should be discussed. I am just worried that this is a fairly drastic step, and would like to see it done (reasonably) right the first time.
But I would love to revisit this discussion once we have a set of pre-conditions based messages that are (provably) working well for beginners.
Cheers,
Elena
--
You received this message because you are subscribed to a topic in the Google Groups "Clojure Dev" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/clojure-dev/A_BXNne8w44/unsubscribe.
To unsubscribe from this group and all its topics, send an email to clojure-dev...@googlegroups.com.
To post to this group, send email to cloju...@googlegroups.com.
Visit this group at http://groups.google.com/group/clojure-dev.
For more options, visit https://groups.google.com/d/optout.