[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
early error detection
Seems you are talking about two different issues - hardware type
checking and processing of source code by the compiler/interpreter.
In fact, your first example precisely shows the value and benefit of
hardware type-checking, but you didn't ask the system to do the check
any sooner. The purpose of the :type specifier in defstruct is
documented as being to control the implementation of the underlying data
structure, not to invoke type-checking, and the macro accessors for
structures are designed to be fast by default, not to be completely
safe. If you want type-checking done early, you could use the :alterant
option to defstruct to add type checks to your code.
I agree with the idea that the compiler could do more, but I've never
come across a lisp compiler that could do very much in this regard.
Perhaps Symbolics' new compiler will do some of this.