Thread View: comp.lang.lisp.x
2 messages
2 total messages
Started by Darrel Monroe
Mon, 02 Nov 1992 19:17
Implode and Explode for Xlisp requested
Author: Darrel Monroe
Date: Mon, 02 Nov 1992 19:17
Date: Mon, 02 Nov 1992 19:17
8 lines
784 bytes
784 bytes
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? Thanks for your assistance. Darrel Monroe dmonroe@ccwf.cc.utexas.edu
Re: Implode and Explode for Xlisp requested
Author: 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
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads