Re: Comparison with atom values

2015-02-12 Thread adrian . medina
You must deref (https://clojuredocs.org/clojure.core/deref) reference values to get the data inside of it. (= @a 0) is the same as saying (= (deref a) 0) Hope this helps! On Thursday, February 12, 2015 at 2:27:39 PM UTC-5, Newbie wrote: > > I am trying to compare atom values with numbers. Fo

Re: Comparison with atom values

2015-02-12 Thread Max Countryman
To compare the value of the atom, you should deref it first. Using deref, you’ll get the current value of the atom: => (deref a) 0 Or using the reader macro: => @a 0 So: => (= @a 0) true Hope that helps, Max > On Feb 12, 2015, at 11:27, Newbie wrote: > > I am trying to compare atom valu

Re: Comparison with atom values

2015-02-12 Thread Timothy Baldridge
deref is used to pull the value out of an atom, ref, or atom (or other reference type). (= (deref a) 0) gives --> true Also there is a shorthand operator: (= @a 0) Timothy On Thu, Feb 12, 2015 at 12:27 PM, Newbie wrote: > I am trying to compare atom values with numbers. For e.g. - > > (def