readtable support added to Kawa
Jocelyn Paine
popx@ifs.org.uk
Wed Jan 22 14:05:00 GMT 2003
Should updating the result of (current-readtable) alter the behaviour of
reading on the current port?
Let's say I want to read #$foo as if it were (dollars foo). I load this
code:
(require 'readtable)
(define (dollar-reader port subchar arg)
(list 'dollars (read port))
)
(set-dispatch-macro-character #\# #\$ dollar-reader (current-readtable))
but then:
#|kawa:6|# #$foo
<stdin>:6:3: invalid dispatch character '$'
The same thing happens if I replace the dollar-reader function by a
function that just writes its arguments, so it looks as though the
function is never getting called.
This is using the 1.6.99 release. I can see what the relevant slib file
(gnu/kawa/slib/readtable.scm) is defining (current-readtable) to return,
but I haven't yet worked out where in the code the reader accesses this.
Jocelyn Paine
http://www.ifs.org.uk/~popx/
+44 (0)7768 534 091
More information about the Kawa
mailing list