1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-06-13 07:10:20 +02:00

(scm_cmp_function): Always return applyless, do not try to be clever.

(subr2less, subr2oless, lsubrless, closureless): Removed.
This commit is contained in:
Marius Vollmer 2004-02-13 00:08:41 +00:00
parent fdad52193f
commit 4287b58f05

View file

@ -346,40 +346,7 @@ quicksort (void *const pbase,
} /* quicksort */ } /* quicksort */
/* comparison routines */ /* comparison routine */
static int
subr2less (SCM less, const void *a, const void *b)
{
return SCM_NFALSEP (SCM_SUBRF (less) (*(SCM *) a, *(SCM *) b));
} /* subr2less */
static int
subr2oless (SCM less, const void *a, const void *b)
{
return SCM_NFALSEP (SCM_SUBRF (less) (*(SCM *) a,
*(SCM *) b,
SCM_UNDEFINED));
} /* subr2oless */
static int
lsubrless (SCM less, const void *a, const void *b)
{
return SCM_NFALSEP (SCM_SUBRF (less)
(scm_cons (*(SCM *) a,
scm_cons (*(SCM *) b, SCM_EOL))));
} /* lsubrless */
static int
closureless (SCM code, const void *a, const void *b)
{
SCM env = SCM_EXTEND_ENV (SCM_CLOSURE_FORMALS (code),
scm_cons (*(SCM *) a,
scm_cons (*(SCM *) b, SCM_EOL)),
SCM_ENV (code));
/* Evaluate the closure body */
return SCM_NFALSEP (scm_eval_body (SCM_CDR (SCM_CODE (code)), env));
} /* closureless */
static int static int
applyless (SCM less, const void *a, const void *b) applyless (SCM less, const void *a, const void *b)
@ -390,21 +357,13 @@ applyless (SCM less, const void *a, const void *b)
static cmp_fun_t static cmp_fun_t
scm_cmp_function (SCM p) scm_cmp_function (SCM p)
{ {
switch (SCM_TYP7 (p)) /* We used to return an optimized invocation routine for certain
{ types of subrs. This is too much hassle to do correctly and
case scm_tc7_subr_2: means too much code duplication with eval.c. So just use
case scm_tc7_rpsubr: 'applyless' for all kinds of procedures.
case scm_tc7_asubr: */
return subr2less;
case scm_tc7_subr_2o: return applyless;
return subr2oless;
case scm_tc7_lsubr:
return lsubrless;
case scm_tcs_closures:
return closureless;
default:
return applyless;
}
} /* scm_cmp_function */ } /* scm_cmp_function */