Alexandre Duret-Lutz <[EMAIL PROTECTED]> writes:
>
> guile> (define (foo a b c) (< b c))
> guile> (sort '(3 2 1) foo)
Thanks.
I get some joy from the change below, but someone smarter than me will
need to verify that it's the right approach. The "if" conditions are
cut and pasted from scm_trampoline_2 in the cvs head.
--- sort.c.~1.36.2.4.~ 2002-03-15 20:33:37.000000000 +1000
+++ sort.c 2004-02-13 09:38:23.000000000 +1000
@@ -401,7 +401,18 @@
case scm_tc7_lsubr:
return lsubrless;
case scm_tcs_closures:
- return closureless;
+ {
+ SCM formals = SCM_CLOSURE_FORMALS (p);
+ if (!SCM_NULLP (formals)
+ && (!SCM_CONSP (formals)
+ || (!SCM_NULLP (SCM_CDR (formals))
+ && (!SCM_CONSP (SCM_CDR (formals))
+ || !SCM_CONSP (SCM_CDDR (formals))))))
+ return closureless;
+ }
+ /* invalid formal parameters, return applyless and let scm_call_2
+ there report the error */
+ /*FALLTHRU*/
default:
return applyless;
}
_______________________________________________
Bug-guile mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/bug-guile