Re: Amb operator

2009-04-13 Thread Victor Rodriguez
On Mon, Apr 13, 2009 at 9:02 PM, David Nolen wrote: > Wow, this is very interesting, on a MBP 2.53 JDK 1.6 > ;; ~2.5 seconds > (time (dotimes [_ 100] > (new Exception))) > ;; ~40ms or 62X faster > (time >  (let [exc (new Exception)] >    (dotimes [_ 100] >      (try >       (throw exc) >

Re: Amb operator

2009-04-13 Thread David Nolen
Wow, this is very interesting, on a MBP 2.53 JDK 1.6 ;; ~2.5 seconds (time (dotimes [_ 100] (new Exception))) ;; ~40ms or 62X faster (time (let [exc (new Exception)] (dotimes [_ 100] (try (throw exc) (catch Exception _) However does also means that you're throwing

Re: Amb operator

2009-04-13 Thread Victor Rodriguez
On Mon, Apr 13, 2009 at 2:13 PM, David Nolen wrote: > One caveat is that because this works by transforming the code into > Continuation Passing Style, it's dog slow, like 2 orders of magnitude for > regular Clojure code. This is not really much of an issue for user interface > related code (whic

Re: Amb operator

2009-04-13 Thread David Nolen
One caveat is that because this works by transforming the code into Continuation Passing Style, it's dog slow, like 2 orders of magnitude for regular Clojure code. This is not really much of an issue for user interface related code (which is what I'm using it for), but unrealistic for pretty much a

Re: Amb operator

2009-04-13 Thread David Nolen
Using try-catch for control flow is probably not a good idea. Shameless plug, do you think you could get this to work with clj-cont? clj-cont is a port I did of cl-cont. It has some limitations, but because Clojure has so few special forms (compared to Common Lisp), it has the chance to achieve pre