[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
- To: RWK at MIT-MC, (BUG LISP) at MIT-MC
- From: GLS at MIT-MC (Guy L. Steele, Jr.)
- Date: Mon, 7 Aug 78 00:26:00 GMT
- Cc: NIL at MIT-MC
- Original-date: 6 AUG 1978 2026-EDT
The subtlety you are missing (and which I admit may never
have been properly documented) is that IN is a type FIXNUM
function. This implies that it can return ONLY fixnum values.
On EOF, it follows the same convention as TYI, namely that
EOF returns a -1 value instead of the standard NIL value (this
has been documented, I am sure). Even if you explicitly
specify an EOF value of NIL, both IN and TYI will "coerce"
this NIL to be a -1.
Unfortunately, unlike TYI, IN is capable of returning any fixnum
whatsoever as a valid result, so -1 cannot serve as a unique flag.
Therefore, because of the constarints on its valid domain and its total
domain, there can be no special distinguished EOF value. It follows
that the THROW trick is in fact the only way to win.
Now perhaps in NIL the use of multiple-return values could provide an
alternative technique, as could the use of continuations (though the latter
would probably be somewhat slower).