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

Re: eof



It does improve program readability to use something symbolic instead
of a -1.  However, there is no reason why this has to require any
read-time syntax.  Just use a symbol whose value is -1.
The compiler could even allow a declaration that the symbol value would
never change, for systems where that would lead to increased
efficiency.  We don't need to have EVERY constant value in the world
have a read-time syntax when there are variables.

This may apply to #\TAB as well.

Instead of a new declaration, we could make DEFCONST values available
at compile time like macros, and then suggest that users use #,.

Alternatively, a reasonable idea is that #\ should be used for ALL
values in a program which are to be considered constant by the
compiler -- for #\ to be the way to ask for a value to be taken as
constant -- and then provide a DEFsomething to define them.


A uniorm convention is important.  We might want to replace the #\TAB
names with something that fits a convention that the user can use as
well, if the convetion isn't using #\.

However, where EOF is concerned, the best code is not a comparison
with -1, but a sign test.  In other words, not (= -1 (TYIPEEK)) but
(MINUSP (TYIPEEK)).  This is true on the Lisp machine and in Maclisp.
If you want to use code which says "eof" in it for clarity, it should
expand into the latter.  So what we need is (EOFVALP (TYIPEEK)) and
let it be the same as MINUSP.