I do not know exactly what is going on, but suspect it is something to do with 
conversion between float and double (or Java Float and Double).

Try replacing the argument 19.1 with each of these possibilities, and you 
should see what I mean:

(double 19.1)
(Double. 19.1)
(float 19.1)
(Float 19.1)

Andy

On Jan 26, 2013, at 8:33 PM, dabd wrote:

> I defined this macro https://gist.github.com/4646206 that expands to a 
> function.
> 
> It behaves like this 
> mycode.core> ((interval-test-fn "9.0,9.7-10.8,19.1+") 19.1)
> false
> 
> mycode.core> (macroexpand-1 '(interval-test-fn "9.0,9.7-10.8,19.1+"))
> (clojure.core/fn [v8568] (clojure.core/or (clojure.core/<= v8568 9.0) 
> (clojure.core/and (clojure.core/>= v8568 9.7) (clojure.core/<= v8568 10.8)) 
> (clojure.core/>= v8568 19.1)))
> 
> mycode.core> ((clojure.core/fn [v8568] (clojure.core/or (clojure.core/<= 
> v8568 9.0) (clojure.core/and (clojure.core/>= v8568 9.7) (clojure.core/<= 
> v8568 10.8)) (clojure.core/>= v8568 19.1))) 19.1)
> true
> 
> 
> So if I call the resulting function with the argument 19.1 it returns false 
> but if I call the macro expanded code directly with the same argument it 
> returns true.
> How to explain this?
> 
> Thanks.

-- 
-- 
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
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Reply via email to