[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Defstruct default values
Maybe I'm missing something, but the book says that the default-init
is evaluated =each time= a structure is to be constructed [emphasis
per CLtL].
> From: Rob MacLachlan
>
> I propose the following "clarification":
>
> The default value for a defstruct slot need not be of the type
> indicated in the :type slot option as long as the default is never
> used.
>
> This is obviously semantically barfucious, but is essential for anyone
> who ever actually uses the :type option, since there is no way to
> specify a type without specifiying a default. In many cases it is
> incredibly difficult to come up with a default expression that you
> can type in which will evaluate to an object of the correct type. I
> have better things to do with my time than write hairy code which is
> never evaluated.
--
scott preece
gould/csd - urbana
ihnp4!uiucdcs!ccvaxa!preece