From a8716de1c3778c147f62d18f1648d8b23163fccf Mon Sep 17 00:00:00 2001 From: dos-reis Date: Tue, 9 Jun 2009 07:08:27 +0000 Subject: * interp/compiler.boot (compLogicalNot): Tidy. * interp/define.boot (doIt): Tidy conditional case. * boot/tokens.boot: 'fourth' is a now a builtin function. --- src/interp/compiler.boot | 3 ++- src/interp/define.boot | 8 +++++++- 2 files changed, 9 insertions(+), 2 deletions(-) (limited to 'src/interp') diff --git a/src/interp/compiler.boot b/src/interp/compiler.boot index 817517ef..357e8564 100644 --- a/src/interp/compiler.boot +++ b/src/interp/compiler.boot @@ -1438,7 +1438,8 @@ compLogicalNot(x,m,e) == $normalizeTree and resolve(m,$Boolean) = $Boolean => $Boolean $EmptyMode yT := comp(y,yTarget,e) or return nil - yTarget = $Boolean => (rplac(first yT, ["NOT",yT.expr]); yT) + yT.mode = $Boolean and yTarget = $Boolean => + [["NOT",yT.expr],yT.mode,yT.env] compResolveCall("not",[yT],m,yT.env) diff --git a/src/interp/define.boot b/src/interp/define.boot index 8cbc7ce9..543450d9 100644 --- a/src/interp/define.boot +++ b/src/interp/define.boot @@ -1482,7 +1482,13 @@ doIt(item,$predl) == item is ["%SignatureImport",:.] => [.,.,$e] := compSignatureImport(item,$EmptyMode,$e) mutateToNothing item - item is ["IF",:.] => doItIf(item,$predl,$e) + item is ["IF",p,x,y] => + p is ["not",p'] => + rplac(second item,p') + rplac(third item,y) + rplac(fourth item,x) + doIt(item,$predl) + doItIf(item,$predl,$e) item is ["where",b,:l] => compOrCroak(item,$EmptyMode,$e) item is ["MDEF",:.] => [.,.,$e]:= compOrCroak(item,$EmptyMode,$e) item is ['DEF,[op,:.],:.] => -- cgit v1.2.3