Oh, and for your specific example, try:

  (and (= a something) (= b another-thing) (foo))

It will return false or (foo).

On Tue, Feb 10, 2009 at 10:08 PM, Onorio Catenacci <catena...@gmail.com>wrote:

>
> Hi all,
>
> Still working on learning Clojure.  I think I know the answer to this
> question (because I seem to have gotten it working) but I wanted to
> confirm that this is the right way to do this.
>
> In C++ I'd write something like this:
>
> if (a == something && b == anotherthing)
> {
>   foo();
> }
>
> Am I correct in thinking the Clojure equivalent is something like
> this:
>
> (if (= a something)
>   (if (= b anotherthing)
>      (foo)
>   )
> )
>
> Or is there another way to perform a logical and that I've missed?  As
> I said the latter form seems to work correctly--I was just wondering
> if there's some simpler way to perform the logical and.  And searching
> for "boolean" "logical" and "and" turned up too mainly results to be
> much use.
>
>
> --
> Onorio Catenacci III
> >
>

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