This is the situation with CVS:

> (my-package::test)

"I was here!" 
#<MY-PACKAGE::MY-GF MY-PACKAGE::FOO>
> #'my-package::foo

#<MY-PACKAGE::MY-GF MY-PACKAGE::FOO>
> (typep #'my-package::foo 'function)

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

NIL

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

Juanjo

2009/11/29 Pascal Costanza <pc@p-cos.net>
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@p-cos.net, http://p-cos.net
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.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Ecls-list mailing list
Ecls-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ecls-list



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