[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
nmap
- To: common-lisp@sail.stanford.edu
- Subject: nmap
- From: frascado@umn-cs.arpa (Gregory Frascadore)
- Date: Sat, 28 Mar 87 10:28:55 CST
Here is another version of an nmap macro that I think addresses the
problems with length vs circular lists:
(defmacro nmap (seq fun &rest seqs)
(let ((arglist (mapcar #'(lambda (dummy) (gensym)) seqs)) )
`(let ((i 0)
(rseq ,seq) )
(map nil
#'(lambda ,(cons (gensym) arglist)
(setf (elt rseq i) (funcall ,fun ,@arglist))
(incf i) )
rseq ,@seqs )
rseq )))
-------
Gregory Frascadore
Computer Science Department frascado%umn-cs.csnet@csnet-relay.arpa
University of Minnesota frascado@umn-cs