]> git.rkrishnan.org Git - sicp.git/commitdiff
added a handy error function
authorRamakrishnan Muthukrishnan <vu3rdd@gmail.com>
Tue, 8 Jun 2010 12:06:48 +0000 (17:36 +0530)
committerRamakrishnan Muthukrishnan <vu3rdd@gmail.com>
Tue, 8 Jun 2010 12:06:48 +0000 (17:36 +0530)
src/sicp/utils.clj

index 258ac6080cb2b19e170c13cb04fcc4da42f48e24..516b0141eba9306c16ded1167c800cb8d5407110 100644 (file)
@@ -42,6 +42,9 @@
 (defn approx-equal [x y]
   (< (abs (- x y)) 0.00001))
 
+(defn error [^String string]
+  (throw (Exception. string)))
+
 (defmacro microbench
   " Evaluates the expression n number of times, returning the average
     time spent in computation, removing highest and lowest values.