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

SFA reading gets stale data



(DEFUN MY-SFA-HANDLER (SELF OP DATA) 
  (CASEQ OP ((WHICH-OPERATIONS) '(TYI UNTYI))
	    ((TYI) (POP (SFA-GET SELF 0.)))
	    ((UNTYI) (COMMENT I DON/'T REALLY CARE))
	    ((INIT) (SETF (SFA-GET SELF 0.) DATA))
	    (T (ERROR "Unsupported call" (LIST 'SFA-CALL SELF OP DATA))))) 

(DEFUN MAKE-AN-SFA (DATA) 
  (LET ((SFA (SFA-CREATE 'MY-SFA-HANDLER 1. "My SFA")))
       (SFA-CALL SFA 'INIT (EXPLODEN DATA))
       SFA)) 

(SETQ A (MAKE-AN-SFA "ABC "))
(READ A) => G00

(GENSYM (ASCII 2.))
(SETQ A (MAKE-AN-SFA "ABC "))
(READ A) => /^B00

(SETQ A (MAKE-AN-SFA "ABCDEFGHIJKLMNOPQRSTUVWXYZ "))
(READ A) => /^B0043FGHIJKLMNOPQRSTUVWXYZ


Where is this coming from? Naturally it does manifest itself in 'real'
programs as well.  -kmp

ps GJC says there is a similar effect with READLINE.