From 5540e847f4137f2a0896b3a6b94f73fff90194df Mon Sep 17 00:00:00 2001 From: Mikael Djurfeldt Date: Fri, 25 Aug 2000 04:08:50 +0000 Subject: * procprop.c: #include "libguile/smob.h"; Check applicable smobs. --- libguile/procprop.c | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) (limited to 'libguile/procprop.c') diff --git a/libguile/procprop.c b/libguile/procprop.c index cd3d56720..b2e76bbb7 100644 --- a/libguile/procprop.c +++ b/libguile/procprop.c @@ -52,6 +52,7 @@ #include "libguile/procs.h" #include "libguile/gsubr.h" #include "libguile/objects.h" +#include "libguile/smob.h" #include "libguile/root.h" #include "libguile/vectors.h" @@ -97,20 +98,27 @@ scm_i_procedure_arity (SCM proc) a += 2; r = 1; break; -#ifdef CCLO - case scm_tc7_cclo: - if (SCM_EQ_P (SCM_CCLO_SUBR (proc), scm_f_gsubr_apply)) + case scm_tc7_smob: + { + int type; + if (!SCM_SMOB_DESCRIPTOR (proc).apply) + return SCM_BOOL_F; + type = SCM_SMOB_DESCRIPTOR (proc).gsubr_type; + goto gsubr_type; + case scm_tc7_cclo: + if (SCM_EQ_P (SCM_CCLO_SUBR (proc), scm_f_gsubr_apply)) { - int type = SCM_INUM (SCM_GSUBR_TYPE (proc)); + type = SCM_INUM (SCM_GSUBR_TYPE (proc)); + gsubr_type: a += SCM_GSUBR_REQ (type); o = SCM_GSUBR_OPT (type); r = SCM_GSUBR_REST (type); break; } - proc = SCM_CCLO_SUBR (proc); - a -= 1; - goto loop; -#endif + proc = SCM_CCLO_SUBR (proc); + a -= 1; + goto loop; + } case scm_tc7_pws: proc = SCM_PROCEDURE (proc); goto loop; -- cgit v1.2.3