Multiple conditions in an if statement?

Discussion of Common Lisp
Post Reply
Super_Stinger
Posts: 5
Joined: Wed May 02, 2012 3:49 am

Multiple conditions in an if statement?

Post by Super_Stinger » Mon May 07, 2012 4:39 am

How would one put multiple conditions in an if statement?

in C/C++ you would use && or &

if (x & y & z)
{blah}

how would you do this in lisp?

ramarren
Posts: 613
Joined: Sun Jun 29, 2008 4:02 am
Location: Warsaw, Poland
Contact:

Re: Multiple conditions in an if statement?

Post by ramarren » Mon May 07, 2012 5:03 am

Use the AND macro. This is fairly trivial question, perhaps reading a book like Practical Common Lisp would be faster than waiting for an answer on a forum (relevant chapter).

Super_Stinger
Posts: 5
Joined: Wed May 02, 2012 3:49 am

Re: Multiple conditions in an if statement?

Post by Super_Stinger » Mon May 07, 2012 5:05 am

Ok, thanks for your VERY quick reply, much appreciated, i tried doing a bit of research but i couldn't find anything on it :\

Post Reply