[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: `thunk?' broken
From: |
Dirk Herrmann |
Subject: |
Re: `thunk?' broken |
Date: |
Wed, 18 Apr 2001 08:59:38 +0200 (MEST) |
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
- `thunk?' broken, Martin Grabmueller, 2001/04/17
- Re: `thunk?' broken,
Dirk Herrmann <=