[Openmcl-devel] applying call-next-method and mop

Gary Byers gb at clozure.com
Fri May 5 12:32:48 PDT 2006


This is fixed in CVS (you just need to rebuild the kernel after a CVS update.)
A method function that did &rest couldn't do CALL-NEXT-METHOD reliably, since
the register in which (among other things) the list of next-methods is passed
is also used while consing up the &rest arg.

This didn't seem to have much to do with standard vs user-defined
metaclasses, but I'd guess that a lot of methods on standard classes
that take an &rest arg and do some flavor of CALL-NEXT-METHOD declare
the &rest arg to have dynamic-extent and bypassed this problem.


On Fri, 5 May 2006, James Bielman wrote:

> Hi,
>
> While trying to build CLSQL on OpenMCL/X86-64 I ran into the following
> (I tried to get a testcase that didn't involve metaclasses but
> couldn't find one...):
>
> ;;; init-instance.lisp
> (use-package '#:openmcl-mop)
>
> (defclass meta (standard-class)
>  ())
>
> (defmethod validate-superclass ((class meta) (superclass standard-class))
>  t)
>
> (defmethod initialize-instance :around ((meta meta) &rest initargs)
>  (apply #'call-next-method meta initargs))
>
> (defclass foo ()
>  ()
>  (:metaclass meta))
>
>
> Welcome to OpenMCL Version 1.1-pre-060505 (Alpha: LinuxX8664)!
> ? (load "init-instance.lisp")
> ;Loading #P"init-instance.lisp"...
>> Error: call-next-method called outside of generic-function dispatch context.
>>        Usually indicates an error in a define-method-combination form.
>> While executing: CCL::%NO-NEXT-METHOD, in process listener(1).
>> Type :POP to abort, :R for a list of available restarts.
>> Type :? for other options.
> 1> :b
> (2AAAABA55748) : 0 (%NO-NEXT-METHOD '(:NAME FOO :DIRECT-SUPERCLASSES NIL :DIRECT-SLOTS ...)) 157
> (2AAAABA55770) : 1 (%CALL-NEXT-METHOD-WITH-ARGS ? [...]) 237
> (2AAAABA557B0) : 2 (%%CNM-WITH-ARGS-COMBINED-METHOD-DCODE #(#<STANDARD-GENERIC-FUNCTION INITIALIZE-INSTANCE #x30000419B2DF> (#<#> #<#> #<#>) (#<STANDARD-GENERIC-FUNCTION INITIALIZE-INSTANCE #x30000419B2DF> #) #<Compiled-function CCL::%%CNM-WITH-ARGS-CHECK-INITARGS #x300004157EDF> (#<#> # NIL #<#>)) ? [...]) 1045
> (2AAAABA55858) : 4 (%MAKE-STD-INSTANCE ? ?) 381
> (2AAAABA55880) : 5 (FUNCALL #'#<#<CCL::STANDARD-KERNEL-METHOD MAKE-INSTANCE (STANDARD-CLASS)>> #<STANDARD-CLASS META> [...]) 157
> (2AAAABA558A8) : 6 (FUNCALL #'#<#<CCL::STANDARD-KERNEL-METHOD ENSURE-CLASS-USING-CLASS (NULL T)>> NIL 'FOO [...]) 277
> (2AAAABA558E0) : 7 (CALL-CHECK-REGS 'CCL::ENSURE-CLASS-FOR-DEFCLASS [...]) 229
> (2AAAABA55918) : 8 (LOAD-FROM-STREAM #<FILE-CHARACTER-INPUT-STREAM ("/home/jamesjb/init-instance.lisp"/4) #x300004C36E8D> ?) 453
> (2AAAABA55970) : 9 (%LOAD ? T ? :ERROR :DEFAULT) 3189
> (2AAAABA55AB0) : 10 (LOAD "init-instance.lisp" [...]) 997
> (2AAAABA55B50) : 11 (CALL-CHECK-REGS 'LOAD [...]) 229
> (2AAAABA55B88) : 12 (TOPLEVEL-EVAL '(LOAD "init-instance.lisp") [...]) 429
> (2AAAABA55BD8) : 13 (READ-LOOP [...]) 1837
> (2AAAABA55DE0) : 14 (TOPLEVEL-LOOP) 205
> (2AAAABA55E10) : 15 (FUNCALL #'#<Anonymous Function #x30000436B39F>) 133
> (2AAAABA55E28) : 16 (FUNCALL #'#<Anonymous Function #x30000443276F>) 1693
> (2AAAABA55EC8) : 17 (RUN-PROCESS-INITIAL-FORM ? '(#)) 653
> (2AAAABA55F48) : 18 (FUNCALL #'#<Anonymous Function #x30000435BADF> ? '(#)) 397
> (2AAAABA55F98) : 19 (FUNCALL #'#<Anonymous Function #x30000434726F>) 365
>
> James
> _______________________________________________
> Openmcl-devel mailing list
> Openmcl-devel at clozure.com
> http://clozure.com/mailman/listinfo/openmcl-devel
>
>



More information about the Openmcl-devel mailing list