Unused lexical functions not (DECLARE IGNORE)'d don't report a STYLE-WARNING as for variables.
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
SBCL |
Triaged
|
Wishlist
|
Unassigned |
Bug Description
What I do:
(flet ((foo ())))
=> NIL
What happens:
Compilation and evaluation proceed without a STYLE-WARNING.
What I expected to happen:
I expected a STYLE-WARNING.
Analysis:
It's already well-established that an unused LET binding results in a STYLE-WARNING unless it's been (DECLARE IGNORE)'d. The above situation is exactly analogous except it takes place in the function namespace, so the same behavior should apply.
If we look at CLHS IGNORE we see it's indeed possible to (DECLARE IGNORE) (or IGNORABLE) a function, reinforcing the idea that the same behavior (a STYLE-WARNING) should apply.
SBCL version: 1.0.51
uname -a: Linux dynamorph 2.6.32-33-generic #72-Ubuntu SMP Fri Jul 29 21:08:37 UTC 2011 i686 GNU/Linux
*features*:
(:SWANK :QUICKLISP :SB-BSD-
:COMMON-LISP :SBCL :SB-DOC :SB-TEST :SB-LDB :SB-PACKAGE-LOCKS :SB-UNICODE
:SB-EVAL :SB-SOURCE-
:SB-THREAD :LARGEFILE :GENCGC :STACK-
:C-STACK-
:RAW-INSTANCE-
:STACK-
:CYCLE-COUNTER :INLINE-CONSTANTS :MEMORY-
:LINKAGE-TABLE :OS-PROVIDES-DLOPEN :OS-PROVIDES-DLADDR :OS-PROVIDES-PUTWC
:OS-PROVIDES-
They are reported. What you're experiencing is the either *evalutor-mode* :interpret, or EVAL muffling of style-warnings from compiling the toplevel form prior to its execution.
CL-USER> (compile nil '(lambda () (flet ((foo () ())))))
; in: LAMBDA ()
; (FLET ((FOO NIL NIL)))
;
; note: deleting unused function
; (FLET FOO)
;
; compilation unit finished
; printed 1 note
#<FUNCTION (LAMBDA ()) {10030DE0D9}>
NIL
NIL