Search found 2 matches
- Sun Jan 24, 2010 12:37 pm
- Forum: Common Lisp
- Topic: Why does taking out nil break this code segment?
- Replies: 10
- Views: 14694
Re: Why does taking out nil break this code segment?
I'd like to amplify the previous comment. In Common Lisp, nested if expressions can often be rewritten as a single cond , and it's generally considered good style to do so. For example, you posted (defun our-member (obj lst) (if (null lst) nil (if (eql (car lst) obj) lst (our-member obj (cdr lst))))...
- Sun Jan 24, 2010 12:20 pm
- Forum: Common Lisp
- Topic: I dont get Macros
- Replies: 31
- Views: 51600
Re: I dont get Macros
(My apologies if I misunderstood your question.) Actually, the bit about evaluation is a very important distinction. Imagine you wanted to express something like (unless (zerop x) (/ foo x)) Obviously, we don't want to do the division unless we know x is not zero. So, we need something that will not...