From 691228879eee8c5f22a032453aa0c95401b1bd6b Mon Sep 17 00:00:00 2001 From: Ramakrishnan Muthukrishnan Date: Tue, 8 Jun 2010 17:36:48 +0530 Subject: [PATCH] added a handy error function --- src/sicp/utils.clj | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/sicp/utils.clj b/src/sicp/utils.clj index 258ac60..516b014 100644 --- a/src/sicp/utils.clj +++ b/src/sicp/utils.clj @@ -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. -- 2.45.2