[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.lisp

sbcl compiler warnings

Jim Newton

9/30/2015 9:16:00 AM

If I try to compile the following function I get a warning that XYZZY is an undefined function.
However, I don't get a warning that 'XYZZY is an undefined class,
nor that 'XYZZY is an undefined condition.

(lambda ()
(xyzzy)
(make-instance 'xyzzy)
(error 'xyzzy))

Does anyone else think that such warnings would be useful?

In my opinion I might define the class XYZZY or the condition XYZZY
later in the same sense that I might define the function later.
2 Answers

Pascal J. Bourguignon

9/30/2015 9:26:00 AM

0

Jim Newton <jimka.issy@gmail.com> writes:

> If I try to compile the following function I get a warning that XYZZY is an undefined function.
> However, I don't get a warning that 'XYZZY is an undefined class,
> nor that 'XYZZY is an undefined condition.
>
> (lambda ()
> (xyzzy)
> (make-instance 'xyzzy)
> (error 'xyzzy))
>
> Does anyone else think that such warnings would be useful?

Actually, it's the warning about the undefined function that is nocive.

In Lisp, we can have forward definitions. sbcl is dumb and seems to be
incapable of dealing with forward definitions of functions without
complaining a lot. It's true that in CL, the compiler is allowed to
hardwire the address of the functions compiled in the same compilation
unit. But if you call a function that is not in the same compilation
unit (and that is not declared inline), then the code generated should
merely do (funcall 'function-name), ie. go thru the symbol to find the
function. This is what sbcl complains about.


> In my opinion I might define the class XYZZY or the condition XYZZY
> later in the same sense that I might define the function later.

Exactly.


--
__Pascal Bourguignon__ http://www.informat...
â??The factory of the future will have only two employees, a man and a
dog. The man will be there to feed the dog. The dog will be there to
keep the man from touching the equipment.� -- Carl Bass CEO Autodesk

Zach Beane

9/30/2015 11:20:00 AM

0

Jim Newton <jimka.issy@gmail.com> writes:

> If I try to compile the following function I get a warning that XYZZY is an undefined function.
> However, I don't get a warning that 'XYZZY is an undefined class,
> nor that 'XYZZY is an undefined condition.
>
> (lambda ()
> (xyzzy)
> (make-instance 'xyzzy)
> (error 'xyzzy))
>
> Does anyone else think that such warnings would be useful?
>
> In my opinion I might define the class XYZZY or the condition XYZZY
> later in the same sense that I might define the function later.

You are more likely to get an informative answer on the sbcl-devel
mailing list than comp.lang.lisp.

Zach