I tried to use :test to constrain the range of a variable, but it
didnt seem to work. Am I misunderstanding the purpose of this keyword?

user=> (def #^{ :doc "Integer between -5 and 5" :test (fn [] (assert
(and (> x -5) (< x 5))))} x 12)
#'user/x
user=> user/x
12

I had hoped this would throw an exception or something...

-- 
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