mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-14 15:40:19 +02:00
fix up some assumptions that cmethods were lists
* libguile/eval.i.c (type_dispatch, apply_vm_cmethod) (apply_memoized_cmethod): Tweak the nastiness a bit more so as to deal with the '(no-method) empty entries. I would like to stop the search if the cdr isn't a pair, but currently with the inlined memoized bits, the cdr is a pair. The fix would be to make the memoizer return a procedure and not the already-inlined bits -- slightly slower but the vm will be faster anyway. * libguile/objects.c (scm_mcache_lookup_cmethod): Same fixes here. * oop/goops/dispatch.scm (cache-hashval, cache-try-hash!): Allow non-list cmethod tails.
This commit is contained in:
parent
5487977b1b
commit
05b37c17ff
3 changed files with 27 additions and 19 deletions
|
@ -138,8 +138,9 @@ scm_mcache_lookup_cmethod (SCM cache, SCM args)
|
|||
z = SCM_CDR (z);
|
||||
}
|
||||
while (j-- && !scm_is_null (ls));
|
||||
/* Fewer arguments than specifiers => CAR != CLASS */
|
||||
if (!SCM_CLASSP (SCM_CAR (z)))
|
||||
/* Fewer arguments than specifiers => CAR != CLASS or `no-method' */
|
||||
if (!scm_is_pair (z)
|
||||
|| (!SCM_CLASSP (SCM_CAR (z)) && !scm_is_symbol (SCM_CAR (z))))
|
||||
return z;
|
||||
next_method:
|
||||
i = (i + 1) & mask;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue