From: Tom Kramer
Subject: power set function
Date: 
Message-ID: <21610@cosmos.cme.nist.gov>
It has been pointed out that the powerset function I posted yesterday
omits nil from the power set. I had read the request incorrectly and
did not see the nil.

The following version corrects that oversight. Both versions could be
made more efficient, of course, by computing (powerset (cdr liz)) only
once and binding it to a variable to re-use it.

(defun powerset (liz)
  (cond ((null liz)
         (list nil))
        (t
         (nconc (mapcar #'(lambda (subset) (cons (first liz) subset))
                        (powerset (cdr liz)))
                (powerset (cdr liz))))))