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

sfa error checking



    Date: 20 December 1980 08:48-EST
    From: Gail Zacharias <GZ at MIT-MC>
    Subject: sfa error checking
    To: BUG-LISP at MIT-MC

    Consider the following session:
        (defun nothin N '())
        NOTHIN 
        (setq test (sfa-create (function nothin) 17. 'testing))
        #SFA-|TESTING|-70766 
        (open test)
        NIL 
        (close test)
        NIL 
        (deletef test)
        NIL 
        (filepos test 13.)
        NIL 
        (sfa-call test (function untyi) ())
        NIL 
        (tyo 3 test)
        T 
        (out test 2)
        NIL 
        (force-output test)
        NIL 
        (prin1 1 test)
        T 
        (princ 'a test)
        T 
        (print 'foo test)
        T 
        (cursorpos test)
        NIL 
        (in test)			;; Well, at least this one errs out
        ;NIL NON-FIXNUM VALUE
      
    Do I have to define all these operations just to have them err out?
    TYI is the only one that actually complains that it is not supported.
Since there is in fact an infinite variety of messages which you can send,
you're expected to do your own error checking.  You don't have to define
ANYTHING to give an error message!  Normally handlers for SFA's are CASEQ's
over the message names, and the T clause is normally a call to CERROR.

This isn't to say that LISP couldn't be doing it's own checking in *RSET T mode
for LISP's internal operations, but there is nothing wrong with writing an
explict (SFA-CALL SFA 'TYO 5), and you should be giving an error message for
this, since you're not returning to in response to WHICH-OPERATIONS.

BTW, the reason (IN TEST) errored out is just that NIL isn't a valid thing to
return from an IN operation.