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

defstruct selector of NIL returns NIL bad idea



CC: GLS at MIT-AI, (BUG LISPM) at MIT-AI

    MOON@MIT-MC 03/18/80 23:01:07 Re: defstruct selector of NIL returns NIL bad idea
    It would certainly have hindered me from detecting dozens of bugs.  You can
    achieve that effect by using :list rather than :array (the default) as the
    structure type.

There is indeed the bug-detection problem.  Hence it would be most
convenient if it were an option in DEFSTRUCT, preferably per-selector.
The problem with using :LIST is that I want the speed of array access
(maybe I'm being fussy, but...).  Actually, as far as bug detection
goes, I'm of the mild opinion that when you allocate things
like arrays and structures the default value of each component should
not be NIL, but rather a null pointer (whatever it is that gives
unbound-variable errors).  The same thing goes for PROG variables,
actually, but that's entrenched in the language.  It's not
so bad to type (FOOSEL ()) instead of FOOSEL in the DEFSTRUCT.