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


Well, the others on this mailing list have provided various rationales
for what *should* be the case.  I will speak to the slightly different
question of what *is* the case, which fortunately results in the same
answer this time.

I interpret the text explaining the ship example on page 306 of the
Common LISP Manual as explicitly indicating that ship-x-position must
have a ship as its argument.  The manual fails to state the obvious
generalization of thislater on (this is a general weakness of the
way this chapter is organized, for which I am sorry).  Nevertheless,
I draw the indirect inference that a structure access function must
receive an argument that is the type of structure for which it was defined,
and anything else is an error.  This means (page 5) that an implementation
may do anything it chooses if a structure acess function is given a NIL,
including returning NIL (though an error message is recommended),
but no valid Common LISP program may depend on any particular behavior
resulting from this situation.  In practical terms, if you write
code that depends on (ship-x-position nil) => nil, it will not be
guaranteed portable.