Article View: comp.lang.lisp.x
Article #238Read Macros in xlisp
From: Ken Whedbee
Date: Mon, 31 Dec 1990 19:07
Date: Mon, 31 Dec 1990 19:07
52 lines
1775 bytes
1775 bytes
Anybody out there messed around with read-macros in xlisp?
If I type this into Common Lisp, I get:
> (set-macro-character #\? #'(lambda (stream char)
(list '*var* (read stream))))
T
> (setq foo '?bar)
(*VAR* BAR)
But if I try the same thing in xlisp, I get instead:
> (setq foo '?bar)
*VAR*
I've tried this on both the Almy-bugpatched xlisp and
a virgin copy of xlisp2.0. For the sake of completeness,
I'm using this defn. of SET-MACRO-CHARACTER that comes
standard in INIT.LSP.
; (set-macro-character ch fun [ tflag ])
(defun set-macro-character (ch fun &optional tflag)
(setf (aref *readtable* (char-int ch))
(cons (if tflag :tmacro :nmacro) fun))
t)
My question: Am I doing anything obviously wrong? Is there a
trick way to get the same thing in xlisp ?
I started to spelunk around in the C source code and evaluating a
readmacro takes you thru quite a trail.
in xlread.c: readone() --> callmacro -->
in xleval.c xlapply() --> evfun() ???
If I want to fix (the Common Lisp compatibility bug ?) can anyone suggest
a good starting point in this trail ?
Ken
kcw@reef.cis.ufl.edu
--
Ken Whedbee Internet: kcw@beach.cis.ufl.edu
University of Florida UUCP: ..!uflorida!beach.cis.ufl.edu!kcw
"C Code. C code run. Run, code, run... PLEASE!!!" -- Barbara Toungue
Technical Details
Message-ID:
<26120@uflorida.cis.ufl.EDU>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!wuarchive!rex!uflorida!kcw@shark.cis.ufl.eduShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!wuarchive!rex!uflorida!kcw@shark.cis.ufl.edu From: kcw@shark.cis.ufl.edu (Ken Whedbee) Newsgroups: comp.lang.lisp.x Subject: Read Macros in xlisp Message-ID: <26120@uflorida.cis.ufl.EDU> Date: 31 Dec 90 19:07:45 GMT Sender: news@uflorida.cis.ufl.EDU Distribution: na Organization: UF CIS Dept. Lines: 52