(if (not (not X)) Y Z) compiles as (if X Y Z), etc.

svn: r1770
This commit is contained in:
Matthew Flatt 2006-01-05 17:37:17 +00:00
parent f4cae8e9ca
commit 274fa978cf

View File

@ -1034,16 +1034,20 @@ static Scheme_Object *resolve_branch(Scheme_Object *o, Resolve_Info *info)
/* Done here because `not' is easily recognized at this
point, and we haven't yet resolved Scheme-stack locations
so it's ok to remove an application. */
if (SAME_TYPE(SCHEME_TYPE(t), scheme_application2_type)) {
Scheme_App2_Rec *app;
while (1) {
if (SAME_TYPE(SCHEME_TYPE(t), scheme_application2_type)) {
Scheme_App2_Rec *app;
app = (Scheme_App2_Rec *)t;
if (SAME_PTR(scheme_not_prim, app->rator)) {
t = tb;
tb = fb;
fb = t;
t = app->rand;
}
app = (Scheme_App2_Rec *)t;
if (SAME_PTR(scheme_not_prim, app->rator)) {
t = tb;
tb = fb;
fb = t;
t = app->rand;
} else
break;
} else
break;
}
t = scheme_resolve_expr(t, info);