I'm new to Lisp (and having a very good time with it), but I am forever
getting style warnings from SBCL. Most are helpful and easily fixed,
but this one baffles me:
STYLE-WARNING: redefining [whatever] in DEFUN
Perhaps my google-foo is even worse than my lisp-foo, but I can't seem
to find an explanation for what this means -- or what the preferred
style might be. About all I've been able to find is this from the SBCL
manual:
SBCL gives style warnings about various kinds of perfectly legal code,
e.g.
- multiple defuns of the same symbol in different units;
I'm not sure if that refers to the error I'm getting, but it seems
close.
I'd love a hint . . .
Steve
--
Stephen Ramsay
web: http://cantor.english.uga.edu/
Den Fri, 05 Aug 2005 00:07:04 +0000, skrev Stephen Ramsay:
> I'm new to Lisp (and having a very good time with it), but I am forever
> getting style warnings from SBCL. Most are helpful and easily fixed,
> but this one baffles me:
>
> STYLE-WARNING: redefining [whatever] in DEFUN
>
> Perhaps my google-foo is even worse than my lisp-foo, but I can't seem
> to find an explanation for what this means -- or what the preferred
> style might be.
Like this?
CL-USER> (defun test (x) (* x 2))
test
CL-USER> (test 2)
4
CL-USER> (defun test (x) (* x 3))
style-warning: redefining test in DEFUN
test
The function `test' is now redefined; it's just a "warning" to inform you
of this happening. It's probably not "bad style" when this is actually
what you want:
CL-USER> (test 2)
6
http://www.sbcl.org/manual/Style-Warnings.html#Style%20Warnings
--
Lars Rune N�stdal
http://lars.nostdal.org/
On 2005-08-05, Lars Rune N�stdal <···········@gmail.com> wrote:
> Like this?
>
>
> CL-USER> (defun test (x) (* x 2))
> test
> CL-USER> (test 2)
> 4
> CL-USER> (defun test (x) (* x 3))
> style-warning: redefining test in DEFUN
> test
Ah, I get it. That's actually a quite useful warning . . .
Thanks so much for your help!
Steve
--
Stephen Ramsay
web: http://cantor.english.uga.edu/
Stephen Ramsay <·······@uga.edu> writes:
> On 2005-08-05, Lars Rune N�stdal <···········@gmail.com> wrote:
> > Like this?
> >
> >
> > CL-USER> (defun test (x) (* x 2))
> > test
> > CL-USER> (test 2)
> > 4
> > CL-USER> (defun test (x) (* x 3))
> > style-warning: redefining test in DEFUN
> > test
>
> Ah, I get it. That's actually a quite useful warning . . .
SBCL's style-warnings don't mean "you have bad style", rather "the
Python compiler has difficulty understanding code written in this
style" and the redefinition warnings. Python is not lint :-)
--
/|_ .-----------------------.
,' .\ / | Free Mumia Abu-Jamal! |
,--' _,' | Abolish the racist |
/ / | death penalty! |
( -. | `-----------------------'
| ) |
(`-. '--.)
`. )----'