[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Chapter 1 and 2 Last Chance Review
(2) Calls from outside the package may store incorrect
types (so even if your portable code is self-consistent
you could wind up with undetected type errors).
I don't know what you mean by (2).
Let's say you're implementing a window system which has slots
WINDOW-WIDTH and WINDOW-HEIGHT. You define these slots to be of type
integer *and* ensure that your code never puts a non-integer in them.
You still have to explicitly check the type of the slot value every
time any code that you didn't write could have run because a user
program could have put a non-integer in the slot without getting an
error in some implementations.