5 lines
125 B
Common Lisp
5 lines
125 B
Common Lisp
|
|
(defun powerset (s)
|
||
|
|
(if s (mapcan (lambda (x) (list (cons (car s) x) x))
|
||
|
|
(powerset (cdr s)))
|
||
|
|
'(())))
|