[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

combining atoms

At  1:22 PM 5/5/93 -0500, Steve Dobbs wrote:
>        I am helping someone port some lisp code from franzlisp to mcl, and
>there is a function that we can find no counterpart for.  In Franzlisp,
>there is an 'explode' and an 'implode' function that we can use to combine
>two atoms into a single atom.  I have found nothing analagous to this in
>Steeles CLtL2, or in any MCL documentation.  Is there anything that I'm
>missing, or is there any utils out there that will do this?

IMPLODE & EXPLODE are ancient Lisp functions. THey are NOT part of Common
Lisp, which doesn't need them. I don't remember whether EXPLODE returned
a list of characters, strings, or symbols, but the following should be close:

(defun explode (symbol)
  (setq symbol (require-type symbol 'symbol))
  (map 'list 'identity (symbol-name symbol)))

(defun implode (list &optional (package *package*))
  (intern (map 'string 'character list) package))