[uim-commit] r1685 - branches/r5rs/sigscheme
yamaken at freedesktop.org
yamaken at freedesktop.org
Fri Sep 30 04:29:05 PDT 2005
Author: yamaken
Date: 2005-09-30 04:29:02 -0700 (Fri, 30 Sep 2005)
New Revision: 1685
Modified:
branches/r5rs/sigscheme/error.c
Log:
* sigscheme/error.c
- (SigScm_ShowBacktrace):
* Simplify
* Rename the local macro 'IS_UNBOUND' to 'UNBOUNDP' to conform to
the standard naming convention of Scheme
Modified: branches/r5rs/sigscheme/error.c
===================================================================
--- branches/r5rs/sigscheme/error.c 2005-09-30 11:08:22 UTC (rev 1684)
+++ branches/r5rs/sigscheme/error.c 2005-09-30 11:29:02 UTC (rev 1685)
@@ -124,10 +124,15 @@
void SigScm_ShowBacktrace(void)
{
+#define UNBOUNDP(var, env) \
+ (NULLP(lookup_environment(var, env)) \
+ && !SCM_SYMBOL_BOUNDP(var))
+
#if SCM_DEBUG
struct trace_frame *f;
+ ScmObj env;
ScmObj obj;
- ScmObj env;
+ ScmObj proc;
SigScm_ErrorPrintf(SCM_BACKTRACE_HEADER);
@@ -141,13 +146,9 @@
SigScm_WriteToPort(scm_current_error_port, obj);
SigScm_ErrorNewline();
-#define IS_UNBOUND(var, env) \
- (NULLP(lookup_environment(var, env)) \
- && EQ(SCM_SYMBOL_VCELL(var), SCM_UNBOUND))
-
switch (SCM_TYPE(obj)) {
case ScmSymbol:
- if (IS_UNBOUND(obj, env))
+ if (UNBOUNDP(obj, env))
break;
SigScm_ErrorPrintf(" - \"%s\": ", SCM_SYMBOL_NAME(obj));
SigScm_WriteToPort(scm_current_error_port, symbol_value(obj, env));
@@ -156,11 +157,13 @@
case ScmCons:
for (; !NULLP(obj); obj = CDR(obj)) {
- if (SYMBOLP(CAR(obj))) {
- if (IS_UNBOUND(CAR(obj), env))
+ proc = CAR(obj);
+ if (SYMBOLP(proc)) {
+ if (UNBOUNDP(proc, env))
break;
- SigScm_ErrorPrintf(" - \"%s\": ", SCM_SYMBOL_NAME(CAR(obj)));
- SigScm_WriteToPort(scm_current_error_port, symbol_value(CAR(obj), env));
+ SigScm_ErrorPrintf(" - \"%s\": ", SCM_SYMBOL_NAME(proc));
+ SigScm_WriteToPort(scm_current_error_port,
+ symbol_value(proc, env));
SigScm_ErrorNewline();
}
}
@@ -169,8 +172,8 @@
default:
break;
}
-#undef IS_UNBOUND
}
+#undef UNBOUNDP
#endif
}
More information about the uim-commit
mailing list