Function: ENSURE-LIST

Documentation

Returns THING as a list. If THING is already a list (as per listp) it is returned, otherwise a one element list containing THING is returned.

Source

(defun ensure-list (thing)
  "Returns THING as a list.

If THING is already a list (as per listp) it is returned,
otherwise a one element list containing THING is returned."
  (if (listp thing)
      thing
      (list thing)))
Source Context