[gambit-list] How to define "set-macro-character" like in Gambit.
Ryuho Yokoyama
ryuho8 at ybb.ne.jp
Thu Jan 22 19:44:17 EST 2015
Hello,
For example,
in Common Lisp
---
(defvar *Data* '((aa 11) (bb 22) (cc 33)))
(set-macro-character #\^
#'(lambda (stream char)
`(cadr (assoc ',(read stream t nil t) *Data*))))
(print ^bb) ; => 22
---
in Gambit I tried like
---
(define *Data* '((aa 11) (bb 22) (cc 33)))
(##readtable-char-handler-set!
(##current-readtable) #\^
(lambda (stm ch)
`(cadr (assoc ',(##read stm) *Data*))
; ^^^^^^^^^^^^ ??
))
(pp ^bb) ; => #!unbound
---
and I faild.
Could you please teach me how to define "set-macro-character" like in Gambit.
Thanks in advance.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.iro.umontreal.ca/pipermail/gambit-list/attachments/20150123/a31a242d/attachment.htm>
More information about the Gambit-list
mailing list