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

Re: error in (read) ing comma inside backquote



>Date: Tue, 11 Feb 92 14:59:14 CST
>From: graham@vax2.cstp.umkc.edu
>To: info-mcl@cambridge.apple.com
>Subject: error in (read) ing comma inside backquote
>
>I get an error whenever I try to use (read) to input a backquoted expression
>containing ",x"  (",@x" works OK)   from *terminal-io*.  It happens when the
>system reads the "x", realizes it isn't an "@" and tries to (untyi) it.  Is 
>there a solution or work-around? 

>To: info-mcl@cambridge.apple.com
>Subject: Bug in readtable facility
>Date: Wed, 12 Feb 92 12:13:22 +0900
>From: Yasuaki Honda <honda@csl.sony.co.jp>
>Dear lispers,
>

[...]

>(defvar *test-readtable* (copy-readtable nil))
>
>(set-macro-character #\! #'test-func *test-readtable*)

That should be:

(set-macro-character #\! #'test-func t *test-readtable*)

The third argument to SET-MACRO-CHARACTER is NON-TERMINATING-P.
The fourth argument is the readtable. Your code modified the
global *readtable*.

[...]

>> Error: No applicable primary method for args:
>>         (#<CCL::TERMINAL-IO-RUBOUT-HANDLER #x531CC1>)
>>         to #<Compiled Generic-function STREAM-LISTEN #x42156E>
>> While executing: #<STANDARD-METHOD NO-APPLICABLE-METHOD (T)>

The following patch will fix both problems:

---------------------------------------------------------------

;;; terminal-io-patch.lisp
;;;
;;; Define stream-untyi & stream-listen for terminal-io-rubout-handler

(in-package :ccl)

(defmethod stream-untyi ((stream terminal-io-rubout-handler) char)
  (stream-untyi (current-listener) char))
(defmethod stream-listen ((stream terminal-io-rubout-handler)) t)