Subject: Re: Functional programming
From: Erik Naggum <erik@naggum.no>
Date: 1999/11/10
Newsgroups: comp.lang.lisp
Message-ID: <3151187105895499@naggum.no>

* Tord Kallqvist Romstad
| This works, of course, but I thought matt meant that all the functions in
| list-of-functions should be used on the same argument (in his example, a
| news article).  Having to construct a list of copies of this single
| argument of the same length as the list of functions seems very
| inconvenient.

  it would indeed, so we don't.  given this very useful function:

(defun circular-list (arg &rest args)
  (let ((car (list arg)))
    (nconc car args car)))

  for a single argument, the answer is simply this:

(mapcar #'funcall <list-of-functions> (circular-list <arg>))

  for a list of arguments, it gets just a _little_ hairier:

(apply #'mapcar #'funcall <list-of-functions>
       (mapcar #'circular-list <arguments>))

  but it's OK to be a little afraid of this code until you figure it out.

#:Erik :)
-- 
  Attention Microsoft Shoppers!  MS Monopoly Money 6.0 are now worthless.