9 lines
238 B
Common Lisp
9 lines
238 B
Common Lisp
|
|
(defun power-set (s)
|
||
|
|
(reduce #'(lambda (item ps)
|
||
|
|
(append (mapcar #'(lambda (e) (cons item e))
|
||
|
|
ps)
|
||
|
|
ps))
|
||
|
|
s
|
||
|
|
:from-end t
|
||
|
|
:initial-value '(())))
|