[gambit-list] how to make write display (quote 1 2 3) instead of '(1 2 3)

Marc Feeley feeley at iro.umontreal.ca
Sat Sep 1 10:34:01 EDT 2007


On 1-Sep-07, at 1:02 AM, naruto canada wrote:

> hi
>
> how to make write display (quote 1 2 3) instead of '(1 2 3)

This should work.

Marc

(define (readtable-read-macro-disable rt)
   (let ((rt (##readtable-copy rt)))
     (##vector-set! rt 16 #f) ;; disable the quote readmacro
     (##vector-set! rt 17 #f) ;; disable the quasiquote readmacro
     (##vector-set! rt 18 #f) ;; disable the unquote readmacro
     (##vector-set! rt 19 #f) ;; disable the unquote-splicing readmacro
     (##vector-set! rt 20 #f) ;; disable the syntax readmacro
     (##vector-set! rt 21 #f) ;; disable the quasisyntax readmacro
     (##vector-set! rt 22 #f) ;; disable the unsyntax readmacro
     (##vector-set! rt 23 #f) ;; disable the unsyntax-splicing readmacro
     rt))

(define (output-port-read-macro-disable! port)
   (let ((rt (output-port-readtable port)))
     (output-port-readtable-set!
      port
      (readtable-read-macro-disable rt))))

(output-port-read-macro-disable! (current-output-port))
(output-port-read-macro-disable! (repl-output-port))




More information about the Gambit-list mailing list