Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!seismo!think!barmar From: barmar@think.COM (Barry Margolin) Newsgroups: comp.lang.lisp Subject: Re: Implode, explode and Common Lisp Message-ID: <7299@think.UUCP> Date: Thu, 6-Aug-87 11:47:50 EDT Article-I.D.: think.7299 Posted: Thu Aug 6 11:47:50 1987 Date-Received: Sat, 8-Aug-87 11:48:42 EDT References: <1840@chalmers.UUCP> <771@cadre.dsl.PITTSBURGH.EDU> Sender: news@think.UUCP Reply-To: barmar@godot.think.com.UUCP (Barry Margolin) Distribution: world Organization: Thinking Machines Corporation, Cambridge, MA Lines: 31 In article <771@cadre.dsl.PITTSBURGH.EDU> geb@cadre.dsl.pittsburgh.edu.UUCP (Gordon E. Banks) writes: >(defun explode (atom-name) > "Explodes the atom name into a list of characters." > (coerce (string atom-name) 'list)) > >(defun implode (charlist) > "Given a list of characters, returns an imploded atom name." > (intern (coerce charlist 'string))) These don't fit the poster's specifications. He said that CHARLIST is a list of symbols and strings, but your IMPLODE expects a sequence of characters. Here are versions that I think are completely compatible with Maclisp. (defun implode (charlist) (intern (map 'string #'character charlist))) ;;; This is more complex because EXPLODE isn't restricted to symbols (defun explode (object &aux (str (make-string 1))) (map 'list #'(lambda (char) (setf (aref str 0) char) (intern str)) (with-output-to-string (s) (prin1 object s)))) --- Barry Margolin Thinking Machines Corp. barmar@think.com seismo!think!barmar