[Ecls-list] ASDF support for deferred warnings in ECL?

Karsten Poeck karsten.poeck at gmail.com
Tue Jan 29 21:05:33 UTC 2013


In article 
<CANejTzrKM5BR0bdZWtKyUakSswW5=NA9ZNBNs8cQKRDRwXXtAw at mail.gmail.com>,
 Juan Jose Garcia-Ripoll 
 <juanjose.garciaripoll at gmail.com> wrote:

> On Tue, Jan 29, 2013 at 3:50 PM, Faré 
> <fahree at gmail.com> wrote:
> 
> > For that, I want to properly handle forward reference warnings from
> > files that are *not* being (re)compiled in the current session but
> > have been in a previous one. And so on supported implementations
> > (currently CCL, SBCL), I am saving the deferred warnings about such
> > forward references. Could you help me do that with ECL?
> >
> 
> Perhaps I am a bit confused. I never really understood the purpose of
> WITH-COMPILATION-UNIT http://clhs.lisp.se/Body/m_w_comp.htm The text says
> 

I thought the whole purpose of with-compilation-unit was to defer 
warnings about undefined functions (forward references).

See the following example, where make-it-2 produces a warning and 
make-it does not. Happens both in sbcl and ccl.

ECL does not produce a warning in either case though (I assume since a c 
compiler doens't, but the problem comes at the linking stage)

Karsten

karsten-poecks-macbook-pro:test karstenpoeck$ cat bar.lisp
;;; bar.lisp
(in-package :cl-user)

(defun bar ()
  (foo))
;;;EOF

karsten-poecks-macbook-pro:test karstenpoeck$ cat foo.lisp
;;; foo.lisp
(defun foo ()
  42)
;;;EOF

karsten-poecks-macbook-pro:test karstenpoeck$ cat make.lisp
;;; make.lisp
(defun make-it ()
  (with-compilation-unit ()
    (compile-file "/Users/karstenpoeck/lisp/test/bar.lisp")
    (compile-file "/Users/karstenpoeck/lisp/test/foo.lisp")))

(defun make-it-2 ()
  (progn
   (compile-file "/Users/karstenpoeck/lisp/test/bar.lisp")
   (compile-file "/Users/karstenpoeck/lisp/test/foo.lisp")))
;;;EOF

karsten-poecks-macbook-pro:test karstenpoeck$ sbcl
This is SBCL 1.1.3.0-e31ed15, an implementation of ANSI Common Lisp.
More information about SBCL is available at <http://www.sbcl.org/>.

SBCL is free software, provided as is, with absolutely no warranty.
It is mostly in the public domain; some portions are provided under
BSD-style licenses.  See the CREDITS and COPYING files in the
distribution for more information.
* (load "make.lisp")

T
* (make-it-2)

; compiling file "/Users/karstenpoeck/lisp/test/bar.lisp" (written 29 
JAN 2013 09:40:24 PM):
; compiling (IN-PACKAGE :CL-USER)
; compiling (DEFUN BAR ...)
; file: /Users/karstenpoeck/lisp/test/bar.lisp
; in: DEFUN BAR
;     (FOO)
; 
; caught STYLE-WARNING:
;   undefined function: FOO
; 
; compilation unit finished
;   Undefined function:
;     FOO
;   caught 1 STYLE-WARNING condition


; /Users/karstenpoeck/lisp/test/bar.fasl written
; compilation finished in 0:00:00.010
; compiling file "/Users/karstenpoeck/lisp/test/foo.lisp" (written 29 
JAN 2013 09:39:41 PM):
; compiling (DEFUN FOO ...)

; /Users/karstenpoeck/lisp/test/foo.fasl written
; compilation finished in 0:00:00.001
#P"/Users/karstenpoeck/lisp/test/foo.fasl"
NIL
NIL
* (quit)

vskarsten-poecks-macbook-pro:test karstenpoeck$ sbcl
This is SBCL 1.1.3.0-e31ed15, an implementation of ANSI Common Lisp.
More information about SBCL is available at <http://www.sbcl.org/>.

SBCL is free software, provided as is, with absolutely no warranty.
It is mostly in the public domain; some portions are provided under
BSD-style licenses.  See the CREDITS and COPYING files in the
distribution for more information.
* (load "make.lisp")

T
* (make-it)

; compiling file "/Users/karstenpoeck/lisp/test/bar.lisp" (written 29 
JAN 2013 09:40:24 PM):
; compiling (IN-PACKAGE :CL-USER)
; compiling (DEFUN BAR ...)

; /Users/karstenpoeck/lisp/test/bar.fasl written
; compilation finished in 0:00:00.007
; compiling file "/Users/karstenpoeck/lisp/test/foo.lisp" (written 29 
JAN 2013 09:39:41 PM):
; compiling (DEFUN FOO ...)

; /Users/karstenpoeck/lisp/test/foo.fasl written
; compilation finished in 0:00:00.002
#P"/Users/karstenpoeck/lisp/test/foo.fasl"
NIL
NIL
* (quit)

or ccl
karsten-poecks-macbook-pro:test karstenpoeck$ 
../compiler/ccl-trunk/ccl/dx86cl64
Welcome to Clozure Common Lisp Version 1.9-dev-r15560M-trunk  
(DarwinX8664)!
? (load "make.lisp")
#P"/Users/karstenpoeck/lisp/test/make.lisp"
? (make-it-2)
;Compiler warnings for "home:lisp;test;bar.lisp.newest" :
;   In BAR: Undefined function FOO
#P"/Users/karstenpoeck/lisp/test/foo.dx64fsl"
NIL
NIL
? (Quit)
karsten-poecks-macbook-pro:test karstenpoeck$ 
../compiler/ccl-trunk/ccl/dx86cl64
Welcome to Clozure Common Lisp Version 1.9-dev-r15560M-trunk  
(DarwinX8664)!
? (load "make.lisp")
#P"/Users/karstenpoeck/lisp/test/make.lisp"
? (make-it)
#P"/Users/karstenpoeck/lisp/test/foo.dx64fsl"
NIL
NIL
?





More information about the ecl-devel mailing list