Here is a small change to assert that allows it to take an optional
message that will part of the exception that is thrown.

Cheers
Brad

Index: src/clj/clojure/core.clj
===================================================================
--- src/clj/clojure/core.clj    (revision 1102)
+++ src/clj/clojure/core.clj    (working copy)
@@ -2429,9 +2429,10 @@
 (defmacro assert
   "Evaluates expr and throws an exception if it does not evaluate to
  logical true."
-  [x]
+  ([x msg]
   `(when-not ~x
-     (throw (new Exception (str "Assert failed: " (pr-str '~x))))))
+     (throw (new Exception (str "Assert failed: " (pr-str '~x)
"\nMessage: " ~msg)))))
+  ([x] `(assert ~x "")))
--~--~---------~--~----~------------~-------~--~----~
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