[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
`thunk?' broken
From: |
Martin Grabmueller |
Subject: |
`thunk?' broken |
Date: |
Tue, 17 Apr 2001 17:28:06 +0200 |
Hello list,
`thunk?' returns #t for procedures which are not thunks. Consider:
guile> (thunk? identity)
#t
guile> (define (f x) x)
guile> (thunk? f)
#t
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.
Regards,
'martin
- `thunk?' broken,
Martin Grabmueller <=