DEFVAR and DEFPARAMETER silently accept variable names not respecting the usual *naming-convention*.
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
SBCL |
Opinion
|
Wishlist
|
Unassigned |
Bug Description
What I do:
(defvar unconventional-
(defparameter unconventional-
What happens:
No warning of any kind is signaled.
What I expected to happen:
I think a STYLE-WARNING would be appropriate.
I seem to remember that SBCL used to do this. I don't know if it's been removed intentionally for a good reason or if this is a regression.
(There's a similar issue with (let ((x 42)) (declare (special x))) but I wouldn't be surprised if tons of code didn't follow the usual *convention* for that, especially if the variable name is a gensym. Even the examples in the standard involving local special variables are like this.)
SBCL version: 1.0.42
uname -a: Linux dynamorph 2.6.32-27-generic #49-Ubuntu SMP Wed Dec 1 23:52:12 UTC 2010 i686 GNU/Linux
*features*:
(:SWANK :QUICKLISP :SB-BSD-
:SBCL :SB-DOC :SB-TEST :SB-LDB :SB-PACKAGE-LOCKS :SB-UNICODE :SB-EVAL
:SB-SOURCE-
:LARGEFILE :GENCGC :STACK-
:COMPARE-
:STACK-
:STACK-
:CYCLE-COUNTER :INLINE-CONSTANTS :MEMORY-
:OS-PROVIDES-
I agree in principle -- particularly after having been bitten by a package that shadowed DEFCONSTANT and replaced it with DEFPARAMETER -- but I think this is also going to be hated by some people very much.
So either this (and some existing ones) need a common superclass for easy muffling, like SB-EXT: STYLISTIC- WARNING or SB-EXT: BAD-STYLE- WARNING or something, or there needs to be a *WARN-ABOUT- STYLISTIC- ISSUES* toggle.