This is the mail archive of the kawa@sources.redhat.com mailing list for the Kawa project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: readtable support added to Kawa


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 




Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]