Search found 2 matches
- Sat Jan 30, 2010 4:45 am
- Forum: Common Lisp
- Topic: Why does taking out nil break this code segment?
- Replies: 10
- Views: 11638
Re: Why does taking out nil break this code segment?
IF has a true part and false part. Taking out nil will mean the false part becomes the true part. But yes the first IF could be replaced by something simpler. (defun our-member (obj lst) (unless (null lst) (if (eql (car lst) obj) lst (our-member obj (cdr lst))))) Would still return nil if lst was n...
- Sat Jan 30, 2010 4:34 am
- Forum: Common Lisp
- Topic: I dont get Macros
- Replies: 31
- Views: 41099
Re: I dont get Macros
I think a practical example would help. Look up the macro aif. There's one in Paul Graham's on-lisp book. It's simple and easy to understand. Once you've got it, try to write something similar, like awhen. Switch to a language you're familiar with and try to implement aif. This will give you a taste...