This is the situation with CVS:

> (my-package::test)

"I was here!" 
> #'my-package::foo

> (typep #'my-package::foo 'function)

> (typep (allocate-instance (find-class 'my-package::my-gf)) 'function)


The first three are OK. The last one is ok, because only initialized instances are recognized as functions.


2009/11/29 Pascal Costanza <>

Another bug report: Consider the following example.

(defpackage :my-package
 (:use :common-lisp :clos))

(in-package :my-package)

(defclass my-gf (standard-generic-function)
 (:metaclass funcallable-standard-class))

(defmethod initialize-instance :around
   ((gf my-gf) &rest initargs)
 (declare (dynamic-extent initargs))
 (print "I was here!")

(defun test ()
 (eval '(defgeneric foo (x y z)
         (:generic-function-class my-gf))))

If I compile this, the load the compiled file, I get an error when running (test). Here is the transcript:

> (in-package :my-package)

#<"MY-PACKAGE" package>
MY-PACKAGE> (test)

The value of GF is #<MY-GF SI:UNBOUND>, which is not of type FUNCTION.

Available restarts:

1. (STORE-VALUE) Supply a new value of GF
2. (RESTART-TOPLEVEL) Go back to Top-Level REPL.

Broken at SI:BYTECODES. [Evaluation of: (DEFGENERIC FOO (X Y Z) (:GENERIC-FUNCTION-CLASS MY-GF))] In: #<process SI:TOP-LEVEL 00000001005c0f60>.

This doesn't happen when I leave out the dynamic-extent declaration. Somehow, the si::no-check-type declaration for gf seems to get lost then (but that's just a guess on my side).

It is indeed the case that (typep (allocate-instance (find-class 'my-gf)) 'function) yields nil.


Pascal Costanza,,
Vrije Universiteit Brussel
Software Languages Lab
Pleinlaan 2, B-1050 Brussel, Belgium

Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.
Ecls-list mailing list

Instituto de Física Fundamental, CSIC
c/ Serrano, 113b, Madrid 28006 (Spain)