[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [spr4709] Some system code apparently calls WARNING, not a defined function?

> <cl 65> (let ((count 0))
>   (defun get-count () count)
>   (defun reset-count () (setq count 0))
>   (defun incf-count () (incf count))
>   ) 
> <cl 66> 
> <cl 66> (compile 'reset-count)
> ; While compiling RESET-COUNT:
> Error: attempt to call `WARNING' which is an undefined function.

  Thanks for pointing out the problem.  What happened was that you
were trying to compile an interpreted closure.  This "is an error" in
CLtL 2 page 677.  The reason is that Common Lisp implementations
represent a lexical environment differently when it is compiled from
when it is interpreted.  "Is an error" means that implementations such
as Allegro are free to extend COMPILE to compile such functions, but
portable Common Lisp programs may not depend on this capability.

  The intended Allegro behavior is to signal a warning and attempt the
compile anyway.  This may or may not produce workable code, but the
user would at least be warned.  However, as you figured, when Allegro
was trying to signal the warning, the function being called was
WARNING instead of WARN.  This has been fixed in the forthcoming 4.1
release (as well as in the already released 4.1.beta).

Charles A. Cox, Franz Inc.        1995 University Avenue, Suite 275
Internet: cox@franz.com           Berkeley, CA  94704
uucp:     uunet!franz!cox         Phone: (510) 548-3600; FAX: (510) 548-8253
                                  > Please Note:  Our new area code is 510.