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

ISSUE: DEFSTRUCT-DEFAULT-VALUE-EVALUATION



You can add to the "Current Practice:" section:

    LUCID does not evaluate the default initialization form unless it is 
    needed; even when it is needed, the type checking is not done at all.
    However, at structure definition time, if an initial value form is
    constanp and doesn't satisfy the :type specification, a warning message
    is printed.

Oddly enough, Lucid's interpreter ensures that SETF's of slots obey the
:type specifier, even though init-forms aren't checked.  Furthermore, in 
safety levels 2 or higher, the compiled code will do minimal "memory-
integrity" type checking for SETF's (which is what I suspect the various 
special-purpose microcoded machines do); however except for low-level numeric
types, this is rarely equivalent to what a full type check would do.

I have long suggested that there should be at least one mode of operation 
such that all :type information is checked when setting values into structure
slots (setf as well as initialization).  Some have suggested that this mode 
could be "when running interpretively, or when when compiled with the highest
degree of SAFETY and lower degrees of SPEED."  However, since the wording of 
CLtL p310 suggests that the :type slot options is merely a DECLARE, and since
some vendors effectively ignore any and all declarations [except for SPECIAL],
then this suggestion hasn't reached proposal stage yet.


-- JonL --