[Ecls-list] Initialization of function metaobjects...

Pascal Costanza pc at p-cos.net
Sat Nov 28 23:00:29 UTC 2009


Hi,

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!")
  (call-next-method))

(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.


Best,
Pascal

-- 
Pascal Costanza, mailto:pc at p-cos.net, http://p-cos.net
Vrije Universiteit Brussel
Software Languages Lab
Pleinlaan 2, B-1050 Brussel, Belgium










More information about the ecl-devel mailing list