I was wondering if it is possible to change a readtable while loading a file. I have the file tt.scm with the following  contents

(output-port-readtable-set!

   (current-output-port)

   (readtable-keywords-allowed?-set

      (output-port-readtable (current-output-port))

      #f))

(input-port-readtable-set!

   (current-input-port)

   (readtable-keywords-allowed?-set

      (input-port-readtable (current-input-port))

      #f))

(display (map keyword? '(foo :foo foo:)))

 

 

If the readtable had changed it would’ve produce #f #f #f  when I had typed (load “tt.scm”). Rather, it displays #f #f #t.

So is it possible to change the readtable of the file currently being read so that display produces the correct output.