Multiple conditions in an if statement?

Discussion of Common Lisp

Multiple conditions in an if statement?

Postby 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?
Super_Stinger
 
Posts: 5
Joined: Wed May 02, 2012 3:49 am

Re: Multiple conditions in an if statement?

Postby 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).
Ramarren
 
Posts: 613
Joined: Sun Jun 29, 2008 4:02 am
Location: Warsaw, Poland

Re: Multiple conditions in an if statement?

Postby 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 :\
Super_Stinger
 
Posts: 5
Joined: Wed May 02, 2012 3:49 am


Return to Common Lisp

Who is online

Users browsing this forum: Google [Bot] and 3 guests