[Ecls-list] Detection and handling of compiler conditions

Juan Jose Garcia-Ripoll juanjose.garciaripoll at googlemail.com
Thu Aug 21 19:47:23 UTC 2008


Things have been further simplified so that only three variables
govern printing of compiler messages. The situation is now as follows.
I would be very happy if anyone (Gaby?) gave some feedback on these
changes.

 - The compiler now signals compiler-error, compiler-warning and compiler-note
   for errors, warnings and notes, respectively.

 - Printing of compiler messages is now ruled by *COMPILE-PRINT*,
*COMPILE-VERBOSE*
   and *SUPPRESS-COMPILER-MESSAGES*. The latter is either NIL or a
valid lisp type
   which denotes which compiler messages are suppressed. If
*SUPPRESS-COMPILER-MESSAGES*
   is NIL and *COMPILE-VERBOSE* is NIL, then no messages are shown.

 - *SUPPRESS-COMPILER-NOTES* and *SUPPRES-COMPILER-WARNINGS* are deprecated and
   will be removed in next release.

 - ECL allows the user to set up handlers for different compiler conditions,
   including errors, warnings and simple notes. The recommended procedure is to
   use HANDLER-BIND and _NOT_ to transfer control out of the compilation
   environment, but to defer to the default handlers or use the restarts ABORT
   and MUFFLE-WARNING.

	(use-package :c)
	(let ((warnings nil))
	  (handler-bind ((compiler-message #'(lambda (c)
					       (push c warnings))))
	    (compile-file "foo.lsp" :verbose nil :print nil))
	  (format t "~&;;; Printing compiler messages")
	  (loop for m in (nreverse warnings)
	     for i from 0
	     do (format t "~&~@<;;; ~@;Message #~D~%~A~:>" i m)))

Juanjo

-- 
Instituto de Física Fundamental
CSIC, Serrano, 113, Madrid 28040 (Spain)
http://juanjose.garciaripoll.googlepages.com


More information about the ecl-devel mailing list