[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
DEFSTRUCT and predicates
- To: Kent M Pitman <KMP@SCRC-STONY-BROOK.ARPA>
- Subject: DEFSTRUCT and predicates
- From: Skef Wholey <Wholey@C.CS.CMU.EDU>
- Date: Tue, 26 Nov 1985 19:20:00 -0000
- Cc: ALAN@MIT-MC.ARPA, Common-Lisp@SU-AI.ARPA, GLS@AQUINAS.THINK.COM
- In-reply-to: Msg of 26 Nov 1985 14:49-EST from Kent M Pitman <KMP at SCRC-STONY-BROOK.ARPA>
- Sender: WHOLEY@C.CS.CMU.EDU
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.