[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Type questions
Date: Tue, 7 Jan 86 03:38 EST
From: Christopher Fry <cfry@OZ.AI.MIT.EDU>
- What's the relationship between keyword, the type,
and keyword, a symbol in the keyword package?
Spicelisp calls the type keyword a subtype of symbol.
They are the same notion. An item of type keyword is a symbol in the
keyword package.
- is (subtype foo foo) true for any valid type foo ?
The book does not require this right now; SUBTYPEP is permitted to throw
up its hands and say "I don't know". The nature of SUBTYPEP and what cases
it is required to handle ought to be tied down more.
- Are the new types: signed-byte and unsigned-byte
subtypes of fixnum, like bit is?
Yes. The descriptions of these types on pages 48-49 explicitly describe
them as being equivalent to specified subtypes of integer (type specifiers
of the form (INTEGER x y)).
- In Spicelisp, COMMON is a subtype of ATOM and
ATOM is a subtype of COMMON. True in CL?
How can COMMON be a subtype of ATOM? CONS must be a subtype of COMMON,
so if COMMON is a subtype of ATOM then CONS must be a subtype of ATOM.
But no cons can be an ATOM (by the definition of ATOM), so if CONS is
a subtype of ATOM then CONS must be an empty type. Therefore if COMMON
is a subtype of ATOM there are no conses.
CLtL should have explicite paragraphs and index entries
for every type. I noticed BIT and KEYWORD lacked this
kind of documentation.
See my next message.