Article View: comp.lang.lisp.x
Article #6Re: Implode and Explode for Xlisp requested
From: Tom Almy
Date: Mon, 02 Nov 1992 22:37
Date: Mon, 02 Nov 1992 22:37
31 lines
1549 bytes
1549 bytes
In article <82877@ut-emx.uucp> dmonroe@ccwf.cc.utexas.edu (Darrel Monroe) writes:
> I would like to obtain implementations of the Implode and Explode functions
>that would run under XLISP-PLUS. I have tried the ones that appear in the
>Lisp FAQ, but they don't work. Has anyone implemented them in XLISP?
A few additional functions need to be implemented, and the MAP version of
explode must be used. Also the symbol Object is a constant in XLISP-PLUS so
the name of the argument must be changed. The result:
(defun read-from-string (arg)
(read (make-string-input-stream arg)))
(defun character (arg)
(coerce arg 'character))
(defun prin1-to-string (arg)
(format nil "~s" arg))
(defun implode (list)
(read-from-string (coerce (mapcar #'character list) 'string)))
(defun explode (obj)
(map 'list #'(lambda (char)
(intern (string char)))
(prin1-to-string obj)))
--
Tom Almy
toma@sail.labs.tek.com
Standard Disclaimers Apply
Technical Details
Message-ID:
<12827@sail.LABS.TEK.COM>Path:
arc1-ca.pugleaf.net!sparky!uunet!europa.asd.contel.com!gatech!swrinde!zaphod.mps.ohio-state.edu!cs.utexas.edu!wupost!spool.mu.edu!sgiblab!cs.uoregon.edu!news.uoregon.edu!news.u.washington.edu!uw-beaver!news.tek.com!sail!tomaReferences:
<82877@ut-emx.uucp>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!europa.asd.contel.com!gatech!swrinde!zaphod.mps.ohio-state.edu!cs.utexas.edu!wupost!spool.mu.edu!sgiblab!cs.uoregon.edu!news.uoregon.edu!news.u.washington.edu!uw-beaver!news.tek.com!sail!toma From: toma@sail.LABS.TEK.COM (Tom Almy) Newsgroups: comp.lang.lisp.x Subject: Re: Implode and Explode for Xlisp requested Message-ID: <12827@sail.LABS.TEK.COM> Date: 2 Nov 92 22:37:48 GMT References: <82877@ut-emx.uucp> Reply-To: toma@sail.labs.tek.com Organization: Tektronix, Inc., Beaverton, OR. Lines: 31