[anaphora-devel] aand only does the first argument?

Gary King gwking at metabang.com
Mon May 26 20:37:03 UTC 2008


I was surprised to find that aand only binds it to the first argument  
rather than binding each one in turn. I'm used to the version in Paul  
Graham's book (below) which lets you do things like

(and (test1) (test2 it) (test3 it) (test4 it) it)

where `it` is bound to the result of each test in turn. Is there a  
deep reason for preferring one over the other. Could both be included?  
Perhaps call the current one `aand` and the one I want `aand+` (ugh?).  
It could also be `aand-multiple`, `nested-aand`, ...

(defmacro aand (&rest args)
   "Anaphoric AND:  Binds the symbol `it' to the value of the  
preceding `arg.'"
   (cond ((null args) t)
         ((null (cdr args)) (car args))
         (t `(aif ,(car args) (aand ,@(cdr args))))))

thanks,
--
Gary Warren King, metabang.com
Cell: (413) 559 8738
Fax: (206) 338-4052
gwkkwg on Skype * garethsan on AIM







More information about the anaphora-devel mailing list