Eric Marsden <eric.marsden@...> writes:
> The following illustrates recent new restrictions on slot-names which
> are probably unwanted (though the STYLE-WARNING is useful).
I'm going to relax this back to the previous state for structure slot
names only; I'll push in a bit.
> * (lisp-implementation-version)
> "1.1.13.18-4c7c37b-dirty"
> * (defstruct foo :bar)
> STYLE-WARNING:
> Keyword slot name indicates probable syntax error in DEFSTRUCT:
> :BAR.
It occurs to me that we could do better than this. What are the syntax
errors that the current situation are catching? I think they're
primarily from forgetting that the defstruct options need to be in a
list with the name, i.e.
(defstruct (foo (:constructor bar)) baz)
somehow becoming
(defstruct foo (:constructor bar) baz)
or
(defstruct foo :constructor bar baz)
So, why don't we issue full warnings for those keywords which match
defstruct options, and let the rest through silently? I suppose a full
warning is unjustified given that the code is strictly speaking
conforming, but it would seem that it might have been useful earlier.
Given that someone who wants to use a slot named constructor can use
(defstruct foo constructor)
without any problems, is there a downside to the full warning?
Cheers,
Christophe