Flatten a list: Difference between revisions

m
Remove surrounding newlines
(→‎{{header|APL}}: Added APL example showing usage of enlist)
m (Remove surrounding newlines)
Line 1,299:
 
=={{header|Emacs Lisp}}==
<lang lisp>(defun flatten (mylist)
(defun flatten (mylist)
(cond
((null mylist) nil)
((atom mylist) (list mylist))
(t
(append (flatten (car mylist)) (flatten (cdr mylist))))))</lang>
</lang>
 
=={{header|Erlang}}==
Anonymous user