Hi,
On my Debian-branded CMUCL (19d-20061116-4_i386), the following
behaviour rather puzzles me:
* (loop for i from 1 to 150
for class-name-1 = (intern (format nil "MULK-SUPERCLASS-~D"
i))
for class-name-2 = (intern (format nil "MULK-CLASS-~D" i))
do (progn (pcl:ensure-class class-name-1
:direct-superclasses `(,(find-
class 'standard-class)))
(pcl:ensure-class class-name-2
:direct-superclasses `(,(find-
class class-name-1)))))
Type-error in KERNEL::INVALID-ARRAY-INDEX-ERROR-HANDLER:
4 is not of type (INTEGER 0 (0))
[Condition of type TYPE-ERROR]
Restarts:
0: [ABORT] Return to Top-Level.
Debug (type H for help)
(MAPHASH #<Closure Over Function "DEFUN MAKE-ACCESSOR-
TABLE" {589F9491}>
#<HASH-TABLE :TEST EQ :WEAK-P NIL :COUNT 65 {2824FEBD}>)
Source:
; File: target:code/hash-new.lisp
(AREF KV-VECTOR (* 2 I))
0]
My observations so far:
(1) The same does not happen if I replace STANDARD-CLASS with STANDARD-
OBJECT.
(2) Using DEFCLASS has the same effect as using ENSURE-CLASS. (I
tried it with a macro.)
Second, CMUCL chokes on the following in the same way, while SBCL runs
it without throwing errors but instead getting slower on every
iteration, making it completely useless there as well:
* (loop for i from 1 to 150
for class-name-1 = (intern (format nil "KLUM-METACLASS-~D" i))
for class-name-2 = (intern (format nil "KLUM-CLASS-~D" i))
do (progn (sb-pcl:ensure-class class-name-1
:direct-superclasses `(,(find-
class 'standard-class)))
(sb-pcl:ensure-class class-name-2
:metaclass class-name-1)))
Unfortunately, I can't tell whether SBCL's slowness and CMUCL's error
messages are symptoms of distinct issues.
Both of these pieces of code (with C2MOP substituted for SB-PCL/PCL)
work on Allegro CL, ECL, CLISP and LispWorks (where by "work" I mean
they (1) don't throw errors and (2) are executed in reasonable amounts
of time).
What am I doing wrong? Is there some kind of MOP restriction that I'm
violating here? Am I mistaken in assuming that it ought to be
possible to define an arbitrary number of subclasses of STANDARD-
CLASS? Is it wrong to subclass STANDARD-CLASS at all?
Thank you,
~ Matthias
Matthias Benkard <··········@gmail.com> writes:
> Second, CMUCL chokes on the following in the same way, while SBCL runs
> it without throwing errors but instead getting slower on every
> iteration, making it completely useless there as well:
At least the SBCL part looks like a fairly recent problem (there was
no non-liner slowdown in version 1.0.6 or earlier). Can you please
send a bug report to the sbcl-devel mailing list?
--
Juho Snellman