From: Ramakrishnan Muthukrishnan Date: Tue, 8 Jun 2010 12:06:48 +0000 (+0530) Subject: added a handy error function X-Git-Url: https://git.rkrishnan.org/components/com_hotproperty/flags/frontends/sub?a=commitdiff_plain;h=691228879eee8c5f22a032453aa0c95401b1bd6b;p=sicp.git added a handy error function --- 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.