logo       

error or warning during compilation, yet some function is generat ed: msg#00136

lisp.clisp.general

Subject: error or warning during compilation, yet some function is generat ed

Hi,

I wonder about the following behaviour

[21]> (lambda(s)(declare (compile))(ffi:with-foreign-string (f s :foo 1)
(values f s)))
;NB: This form is erroneous.

ERROR in :LAMBDA-2 :
Constant :FOO cannot be bound.
WARNING in LAMBDA :
variable S is not used.
Misspelled or missing IGNORE declaration?
#<COMPILED-CLOSURE :LAMBDA>

; I.e. an error is reported, yet compilation continues, and returns a weird
function object:

[22]> (funcall *)
NIL
[23]> (disassemble **)

Disassembly of function :LAMBDA
0 required arguments
0 optional arguments
No rest parameter
No keyword parameters
2 byte-code instructions:
0 (NIL)
1 (SKIP&RET 1)
#<COMPILED-CLOSURE :LAMBDA>
;I.e. a function which takes no arguments(! -- where did S go?) and returns NIL.

This behaviour is different from doing
[24]> (defun foo (s) (ffi:with-foreign-string (f s :foo 1) (values f s)))
FOO
[25]> (compile *)
ERROR in FOO-2 :
Constant :FOO cannot be bound.
WARNING in FOO :
variable S is not used.
Misspelled or missing IGNORE declaration?
NIL ;
2 ;
1
No function was produced in this case, which I feel fine.

Comments welcome,
Jörg Höhle


-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise