chicken-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Chicken-users] Backslash-symbol changed from \ to \\ between 4.5.0


From: Peter Danenberg
Subject: Re: [Chicken-users] Backslash-symbol changed from \ to \\ between 4.5.0 and 4.6.0
Date: Tue, 5 Oct 2010 18:45:05 -0500
User-agent: Mutt/1.5.16 (2007-06-11)

Quoth Peter Danenberg on Pungenday, the 59th of Bureaucracy:
> [C]an we revert to the old behaviour, or can I revert locally by
> using `set-read-syntax!'?

Fortunately or unfortunately, this hideous hack suffices to bring back
the 4.5.0 behaviour without permanently modifying the global
read-table:

  (define (call-with-read-syntax char-or-symbol proc thunk)
    (let ((old-read-table (copy-read-table (current-read-table))))
      (dynamic-wind
          (lambda () (void))
          (lambda ()
            (set-read-syntax! char-or-symbol proc)
            (thunk))
          (lambda () (set! current-read-table
                           (lambda () old-read-table))))))

  ;;; 4.5.0 behaviour: '\ => '\
  (call-with-read-syntax
   #\\
   (lambda (port) '\\)
   (lambda ()
     (with-input-from-string "'\\" read)))

  ;;; 4.6.0 behaviour: '\\ => '\
  (with-input-from-string "'\\\\" read)

I didn't see any mention of this change to the reader in NEWS; was it
intentional?



reply via email to

[Prev in Thread] Current Thread [Next in Thread]