Closed rtoy closed 2 weeks ago
The warning is a ccl::shadowed-typecase-clause, which is a subtype of style-warning.
https://trac.clozure.com/ccl/ticket/872
So, you could write something like the following to suppress it.
(handler-bind ((warning
(lambda (c)
(if (typep c 'ccl::shadowed-typecase-clause)
(muffle-warning c)))))
(load "~/f.lisp"))
Maybe cl:style-warning
instead of ccl::shadowed-typecase-clause
would be preferable, to avoid the internal symbol (I don't know why it's internal, to be honest).
Thanks for your suggestion. I'll look into how to use this to silence the warning.
Feel free to close this issue, if this is the intended behavior.
I'm going to close this as "working as intended".
The entry in the spec for typecase says
The compiler may choose to issue a warning of type style-warning if a clause will never be selected because it is completely shadowed by earlier clauses.
I hope that it is not too burdensome to muffle style-warnings in cases like this where the shadowing is known to be harmless.
Maxima has this function:
CCL64 (1.12.2 (v1.12.2-66-g7e9ea2a9) LinuxX8664) prints this warning when compiling this form:
I can see it can be useful especially if the clauses for
single-float
andshort-float
have truly different results. In this case, the results aren't actually different sincemost-negative-single-float
andmost-negative-short-float
areeq
.Other lisps (clisp, cmucl) don't warn about this.
I suppose a way to suppress this warning would be acceptable. (Need to read the manual to see if this is possible.)