Re: todo for 0.14.4

Gary Byers <[email protected]> Sat, 13 Aug 2005 05:12:07 -0600 (MDT)
Newsgroups gmane.lisp.openmcl.bugs
Message-ID <[email protected]>
SAVE-APPLICATION ordinarily clears caches that are used in generic
function dispatch.  As soon as #'ADD-METHOD is called in a new image,
its cache is non-empty, and loading ASDF causes ADD-METHOD to be
called many times.

If you do:

? (require "ASDF")

in a fresh lisp, and then do

? (ccl:clear-clos-caches)

the test case will get a PROGRAM-ERROR as expected.

It'd be tempting to say that GF's should do number-of-args checking
before they do much of anything else.  They don't have a concise
notion of their minimum/maximum arguments, and only discover the
too-few-args case while trying to find the Nth specialized parameter
and it turns out to be missing.

Fixing this case might qualify as low-hanging fruit (if we're going
to claim no-applicable-method for a particular set of args, we could
check to see if that set of args is too small in the first case.  I'm
not sure that all other wrong-number-of-args cases would necessarily
get detected as part of the (fairly hairy) cache lookup code, and
it may ultimately be necesary to do explicit (and fairly efficient)
checks very early in the process.

On Sat, 13 Aug 2005, bryan o'connor wrote:

> somehow asdf (or the effect of loading it) causes the
> discrepancy between what you and i see..
>
>> openmcl -n
> Welcome to OpenMCL Version (Beta: DarwinPPC32) 0.14.4-pre-050812!
> ? (add-method #'print-object)
>> Error in process listener(1): Too few args to: #<STANDARD-GENERIC-FUNCTION 
> ADD-METHOD #x8074866>
>> While executing: CCL::NTH-ARG-DCODE-TOO-FEW-ARGS
>> Type :POP to abort.
> Type :? for other options.
> 1 > ^D
> ? (require :asdf)
> :ASDF
> ("ASDF")
> ? (add-method #'print-object)
>> Error in process listener(1): No applicable method for args:
>>                                (#<STANDARD-GENERIC-FUNCTION PRINT-OBJECT 
> #x80721FE>)
>>                                to #<STANDARD-GENERIC-FUNCTION ADD-METHOD 
> #x8074866>
>> While executing: #<CCL::STANDARD-KERNEL-METHOD NO-APPLICABLE-METHOD (T)>
>> Type :POP to abort.
> Type :? for other options.
> 1 >
>
>>>> (add-method #'print-object)
>>> 
>>> should throw program-error because the wrong number of
>>> args was given.  num arg checking seems to be bypassed.
>>> 
>>> 
>> 
>> Welcome to OpenMCL Version (Beta: DarwinPPC32) 0.14.4-pre-050809a!
>> ? (add-method #'print-object)
>> 
>>> Error in process listener(1): Too few args to: #<STANDARD-GENERIC-FUNCTION 
>>> ADD-METHOD #x8074E56>
>>> While executing: NTH-ARG-DCODE-TOO-FEW-ARGS
>>> Type :POP to abort.
> _______________________________________________
> Bug-openmcl mailing list
> [email protected]
> http://clozure.com/mailman/listinfo/bug-openmcl
>
>