[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
DEFSTRUCT and predicates
Date: Tuesday, 26 November 1985 14:49-EST
From: Kent M Pitman <KMP at SCRC-STONY-BROOK.ARPA>
The :PREDICATE option to DEFSTRUCT (CLtL, p312) violates the supposed
convention for the formation of predicate names (CLtL, p71) by blindly
adding -P to the end of the symbol rather than adding just "P" when
there is no "-" in the base symbol.
Yeah, at one point the language spec (or at least the language specifiers) said
that defstrict would "do the right thing" with defstruct predicates. This
decision was changed to the current one for some reason I don't recall. Note
that one can get the right effect by specifying the predicate name onesself.
As both an implementor and user of defstruct, I like the current situation -- I
don't think the naming conventions used by the system supplied functions should
be forced upon every single programmer.
Of course, Common Lisp follows a somewhat more complicated hueristic with
"-P"'ing things (e.g. Alpha-Charp). It's better that a program like defstruct
always do the same predictable dumb thing all the time than try to be clever
when it's going to be wrong occasionally.