Permalink
Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
16 lines (13 sloc) 401 Bytes
(in-package #:utils-frahm)
(defun flatten (x)
"Flattens a CONS tree."
(labels ((rec (x acc)
(cond ((null x) acc)
((atom x) (cons x acc))
(t (rec
(car x)
(rec (cdr x) acc))))))
(rec x nil)))
(defun listify (x)
"Ensures X is either a list or wrapped in one."
(if (not (listp x)) (list x) x))