[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
more on yesterday's TYIPEEK lossage
- To: BUG-MACLISP at MIT-MC
- Subject: more on yesterday's TYIPEEK lossage
- From: Alias for KMP <TURNIP at MIT-MC>
- Date: Thu, 21 May 81 06:13:00 GMT
- Original-date: 21 May 1981 02:13-EDT
INCST3: TLNE T,SO.TIP ;FOO! TYIPEEK IS DIFFERENT!
TDZA C,C ; BUT IF NOT TYIPEEK THEN USE
MOVEI C,INCST3 ; NEW EOF VALUE, SOMETHING UNIQUE
PUSHJ P,ISTCAL ;CALL THE SFA
POP P,C ;RESTORE EOF VALUE
CAIN A,INCST3 ;DID THE SFA RETURN EOF?
JRST INCST4 ;YES, HANDLE IT
JSP T,FXNV1 ;ELSE THE VALUE RETURNED MUST BE A FIXNUM
POPJ P,
-----
Note how SFA's get sent a NIL but on return check for INCST3 ...? How is
the guy going to know to return that? I just did
(SETQ STREAM (SFA-CREATE #'(LAMBDA (SELF OP DATA)
(CASEQ OP
((WHICH-OPERATIONS) '(TYIPEEK))
((TYIPEEK) '#,(MUNKAM (GETDDTSYM 'INCST3)))
(T (ERROR "Loss" OP))))
0. "Loss"))
(TYIPEEK NIL STREAM) => -1.
(TYIPEEK NIL STREAM -3) => -3.
which is the kind of behavior that I want... Somehow this need for
#,(MUNKAM ...) seems awkward, though.