From: Robert E. B. <br...@te...> - 2002-12-12 04:42:06
|
It looks like the SBCL compiler does not know that the return value of (coerce foo 'function) is of type function. Here's a transcript. I am using an old version of SBCL, so perhaps this is fixed in a more recent release. bob ==================== loki <6> sbcl This is SBCL 0.7.9, an implementation of ANSI Common Lisp. SBCL is derived from the CMU CL system created at Carnegie Mellon University. Besides software and documentation originally created at Carnegie Mellon University, SBCL contains some software originally from the Massachusetts Institute of Technology, Symbolics Incorporated, and Xerox Corporation, and material contributed by volunteers since the release of CMU CL into the public domain. See the CREDITS file in the distribution for more information. SBCL is a free software system, provided as is, with absolutely no warranty. It is mostly in the public domain, but also includes some software copyrighted Massachusetts Institute of Technology, 1986; Symbolics, Inc., 1989, 1990, 1991, 1992; and Xerox Corporation, 1985, 1986, 1987, 1988, 1989, 1990 used under BSD-style licenses allowing copying only under certain conditions. See the COPYING file in the distribution for more information. More information about SBCL is available at <http://sbcl.sourceforge.net/>. * (defun foo () (let ((fn (coerce *wow* 'function))) (funcall fn 2 3))) ; in: LAMBDA NIL ; (FUNCALL FN 2 3) ; --> SB-C::%FUNCALL ; ==> ; (SB-KERNEL:%COERCE-CALLABLE-TO-FUN FUNCTION) ; ; note: unable to ; optimize away possible call to FDEFINITION at runtime ; due to type uncertainty: ; The first argument is a (OR FUNCTION SYMBOL), not a FUNCTION. ; (COERCE *WOW* 'FUNCTION) ; ; caught STYLE-WARNING: ; undefined variable: *WOW* ; ; caught STYLE-WARNING: ; This variable is undefined: ; *WOW* ; ; compilation unit finished ; caught 2 STYLE-WARNING conditions ; printed 1 note FOO * |