From: Philippe Mechai
Subject: SBCL and STYLE-WARNING
Date: 
Message-ID: <slrneuhi75.qgu.toonsy@cartman.mechai.lan>
Hi,

Sorry if it has already been asked but I couldn't find any answer.

I made a simple program with a bunch of functions.
When loading it in SBCL I get the following messages:
; caught STYLE-WARNING:
;   undefined function: DOUBLE-P

I took care of declaring functions before referencing them in others
(not sure if it is useful) but that doesn't help.

I tried to load the same file from CLISP and didn't get any message.

Note that it doesn't prevent my program from working but I'm curious to
know why these messages show up when loading the file (I'm still a
beginner so I'd like to understand things fully).

Thanks in advance for your answers.

Regards.

From: Matthias Benkard
Subject: Re: SBCL and STYLE-WARNING
Date: 
Message-ID: <1172884632.255702.135330@v33g2000cwv.googlegroups.com>
Hi,

> I took care of declaring functions before referencing them in others
> (not sure if it is useful) but that doesn't help.

I presume you mean you took care of _defining_ functions before
referencing them?

Anyway, SBCL is telling you that the function DOUBLE-P has not been
defined at the point the warning is raised.  Are you sure you haven't
made any typos?  For instance, is DOUBLE-P actually called DOUBLE-P
rather than, say, DOUBLEP?  Also, if you use LOAD rather than COMPILE-
FILE, SBCL may complain about functions that are not defined prior to
their first occurrence in the source code, but that's nothing to be
worried about, because you aren't required to do that.

Of course, I'm just guessing wildly.  If this isn't a peculiarity or
bug in SBCL that I'm unaware of, we'll probably need your source code
in order to figure out what's wrong.

Matthias
From: Philippe Mechai
Subject: Re: SBCL and STYLE-WARNING
Date: 
Message-ID: <slrneuieu1.qgu.toonsy@cartman.mechai.lan>
Le 03-03-2007, Matthias Benkard <··········@gmail.com> a écrit :
> Hi,
>
>> I took care of declaring functions before referencing them in others
>> (not sure if it is useful) but that doesn't help.
>
> I presume you mean you took care of _defining_ functions before
> referencing them?
>
Right.

> Anyway, SBCL is telling you that the function DOUBLE-P has not been
> defined at the point the warning is raised.  Are you sure you haven't
> made any typos?  For instance, is DOUBLE-P actually called DOUBLE-P
> rather than, say, DOUBLEP?  Also, if you use LOAD rather than COMPILE-
> FILE, SBCL may complain about functions that are not defined prior to
> their first occurrence in the source code, but that's nothing to be
> worried about, because you aren't required to do that.
>
That's what I did yes.

> Of course, I'm just guessing wildly.  If this isn't a peculiarity or
> bug in SBCL that I'm unaware of, we'll probably need your source code
> in order to figure out what's wrong.
>
> Matthias
>

The source code is here: http://t00nsy.free.fr/hand-utils.lisp

Thanks.
From: Alex Mizrahi
Subject: Re: SBCL and STYLE-WARNING
Date: 
Message-ID: <45e93f0d$0$90272$14726298@news.sunsite.dk>
(message (Hello 'Philippe)
(you :wrote  :on '(03 Mar 2007 09:11:20 GMT))
(

 ??>>> I took care of declaring functions before referencing them in others
 ??>>> (not sure if it is useful) but that doesn't help.
 ??>>
 ??>> I presume you mean you took care of _defining_ functions before
 ??>> referencing them?
 ??>>
 PM> Right.

how?
double-p is defined at bottom of file, while referenced in compare-hands in 
the top of the file, so warning is perfectly legal.

LOAD basically just executes forms in order, as they were typed in 
top-level, so it cannot guess that form is defined somewhere later in a 
file.

COMPILE-FILE is more clever, it will not give you warning if function is 
defined later.

)
(With-best-regards '(Alex Mizrahi) :aka 'killer_storm)
"?? ???? ??????? ?????") 
From: Rob Warnock
Subject: Re: SBCL and STYLE-WARNING
Date: 
Message-ID: <veCdnacKG5nhzXTYnZ2dnUVZ_rmdnZ2d@speakeasy.net>
Alex Mizrahi <········@users.sourceforge.net> wrote:
+---------------
| (message (Hello 'Philippe)
| (you :wrote  :on '(03 Mar 2007 09:11:20 GMT))
|  ??>> I presume you mean you took care of _defining_ functions before
|  ??>> referencing them?
|  ??>>
|  PM> Right.
| 
| how?
| double-p is defined at bottom of file, while referenced in
| compare-hands in  the top of the file, so warning is perfectly legal.
| 
| LOAD basically just executes forms in order, as they were typed in 
| top-level, so it cannot guess that form is defined somewhere later
| in a file.
+---------------

I sometimes run into this with CMUCL "scripts" or when compiling
functions that reference functions compiled separately in other files.
My usual solution to shut up CMUCL is to simply declare the names
as otherwise-unspecified functions, e.g.:

    ;;; Shut up fwd-ref warnings:
    (declaim (ftype function mmap r8 r16 r32 w8 w16 w32 d32 dump32
			     memcpy memcmp spin-until-change))


-Rob

-----
Rob Warnock			<····@rpw3.org>
627 26th Avenue			<URL:http://rpw3.org/>
San Mateo, CA 94403		(650)572-2607
From: Philippe Mechai
Subject: Re: SBCL and STYLE-WARNING
Date: 
Message-ID: <slrneuij5g.qgu.toonsy@cartman.mechai.lan>
Le 03-03-2007, Alex Mizrahi <········@users.sourceforge.net> a écrit :
> (message (Hello 'Philippe)
> (you :wrote  :on '(03 Mar 2007 09:11:20 GMT))
> (
>
>  ??>>> I took care of declaring functions before referencing them in others
>  ??>>> (not sure if it is useful) but that doesn't help.
>  ??>>
>  ??>> I presume you mean you took care of _defining_ functions before
>  ??>> referencing them?
>  ??>>
>  PM> Right.
>
> how?
> double-p is defined at bottom of file, while referenced in compare-hands in 
> the top of the file, so warning is perfectly legal.
>
> LOAD basically just executes forms in order, as they were typed in 
> top-level, so it cannot guess that form is defined somewhere later in a 
> file.
>
> COMPILE-FILE is more clever, it will not give you warning if function is 
> defined later.
>
> )
> (With-best-regards '(Alex Mizrahi) :aka 'killer_storm)
> "?? ???? ??????? ?????") 
>
>

You're right ! I actually had two version of the file. One which was
correct and the other one which is the one I published.
Guess which one I was loading... :/

Sorry for the noise.