On Tue, 17 Apr 2001, Martin Grabmueller wrote:
> Looking at the implementation of `thunk?' (procs.c:238), I see:
>
> switch (SCM_TYP7 (obj))
> {
> case scm_tcs_closures:
> if (SCM_NULLP (SCM_CAR (SCM_CODE (obj))))
> return SCM_BOOL_T;
> case scm_tc7_subr_0:
> case scm_tc7_subr_1o:
> case scm_tc7_lsubr:
> case scm_tc7_rpsubr:
> case scm_tc7_asubr:
> #ifdef CCLO
> case scm_tc7_cclo:
> #endif
> return SCM_BOOL_T;
>
> Isn't there a `break' or `return' or something missing after the first
> case? I'm not sure about the correct fix, because I don't understand
> all the procedure types in Guile yet.
You are right: for the case of closures the code should be
if (SCM_NULLP (SCM_CAR (SCM_CODE (obj))))
return SCM_BOOL_T;
else
return SCM_BOOL_F;
or shorter
return SCM_BOOL (SCM_NULLP (SCM_CAR (SCM_CODE (obj))));
For the other cases it is OK.
Best regards,
Dirk Herrmann
_______________________________________________
Bug-guile mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/bug-guile