I'm using pre / post assertions quite a bit in a project I'm building. And I too would love to see better or custom error messages for each assertion.
They do work great btw, as a way of failing fast. Tim On Sat, Jul 2, 2011 at 10:52 PM, Glen Stampoultzis <gst...@gmail.com> wrote: > On 3 July 2011 11:26, Mark Engelberg <mark.engelb...@gmail.com> wrote: > >> But Clojure's >> lack of a "fail-fast" philosophy has burned me several times, with >> hard-to-track-down bugs that were far-removed from the actual cause. >> The larger my code grows, the more this annoys me, reminding me too >> much of my days tracking down bugs in imperative programs. >> >> > I wonder if many people use the pre and post assertions when coding > Clojure? Assertions (& pre/post-conditions) seem to have lost favour as a > go-to tool for programmers. Most coders instead seem to go for unit testing > exclusively. It seems to me that assertions could provide a lot benefit in > dynamic programs as a way to fail-fast and as a way to document intention. > In my limited experiments with them I've found them to be helpful. I do > wish Clojure would give greater detail as to what went wrong when an > assertion fails though. See Groovy's assert statement for an example of a > very helpful error report [1]. > > [1] > http://dontmindthelanguage.wordpress.com/2009/12/11/groovy-1-7-power-assert/ > > -- > 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 > -- 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