I wonder if you could help me by answering a couple of
questions about your OpenLisp interpreter?
I have some Scheme code that I wanted to run under ISlisp
and I have already made it work under Common Lisp using
some macros. When I tried to do the same under ISlisp I
ran in to problems. Here are my questions.
I wish to modify the reader in order to use '#t'
and '#f' for true and false. In common lisp I used,
- Code: Select all
;;;
(set-dispatch-macro-character #\# #\T
#'(lambda (stream subchar arg)
t))
This works fine in Common Lisp but 'set-dispatch-macro-character'
is undefined in your ISlisp implementation.
So I tried instead to use 'set-macro-character' and used,
- Code: Select all
;;;
(defvar default-dispatcher (get-macro-character #\#))
;
(defun bool-dispatcher (stream char)
(case (preview-char stream) ; ISlisp
; (case (peek-char nil stream) ; Clisp
((#\t #\T) (read-char stream) t)
((#\f #\F) (read-char stream) nil)
(t (funcall default-dispatcher stream char))))
;
(set-macro-character #\# #'bool-dispatcher)
Again this works fine in Common Lisp *but* apparently
'(get-macro-character #\#)' returns 'nil' in your ISlisp
whereas it should return the default dispatcher function
and so although '#t' and '#f' are OK, all other uses of '#' now fail.
Surely this is not correct since '#' is operating as a
macro character in, for example, '#\a and others.
How can I implement the desired behaviour using your
ISlisp interpreter?
Thanks for your help,
Stephen Lewis