I find the wording of this confusing "otherwise it returns the value
of the last
expr. (and) returns true."
I mean, I know it returns the last true value, but that's because I've
tested it not because the doc is trying(failing) to tell me so with that
phrase.



On Wed, May 22, 2013 at 1:28 PM, atkaaz <atk...@gmail.com> wrote:

>
>
>
> On Wed, May 22, 2013 at 3:06 AM, Peter Mancini <pe...@cicayda.com> wrote:
>
>>  I noticed that '(nil nil true) will cause "and" to produce false, so I
>> am aware of that edge case. Anything else I should be aware of?
>>
>> What about the other edge?
> user=>  (reduce #(and %1 %2) '(1 true 2))
> 2
> user=> (eval (conj '(1 true 3) 'and))
> 3
>
> user=> (doc and)
> -------------------------
> clojure.core/and
> ([] [x] [x & next])
> Macro
>   Evaluates exprs one at a time, from left to right. If a form
>   returns logical false (nil or false), and returns that value and
>   doesn't evaluate any of the other expressions, otherwise it returns
>   the value of the last expr. (and) returns true.
> nil
>
>
>> 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
>> ---
>> You received this message because you are subscribed to the Google Groups
>> "Clojure" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to clojure+unsubscr...@googlegroups.com.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>>
>>
>
>

-- 
-- 
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
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to