From b06599402ca23cce8ba7eea03886dc11a5d29af4 Mon Sep 17 00:00:00 2001 From: dos-reis Date: Tue, 22 Jun 2010 17:20:38 +0000 Subject: Group sequence of LETT definitions into LET/LET* expressions where appropriate. * interp/g-opt.boot (jumpToToplevel?): New. (singleAssignment?): Likewise. (groupVariableDefinitions): Likewise. Use them. (optimizeFunctionDef): Group toplevel variable definitions into a bind expression. * interp/g-util.boot (expandBind): Tidy. * interp/c-util.boot (transformToBackendCode): Refrain from enclosing let-expressions in SEQ if not needed. --- src/algebra/strap/NNI.lsp | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) (limited to 'src/algebra/strap/NNI.lsp') diff --git a/src/algebra/strap/NNI.lsp b/src/algebra/strap/NNI.lsp index 5419507e..184b8ab6 100644 --- a/src/algebra/strap/NNI.lsp +++ b/src/algebra/strap/NNI.lsp @@ -31,15 +31,12 @@ (ASH |x| |n|)) (DEFUN |NNI;subtractIfCan;2$U;3| (|x| |y| $) - (PROG (|c|) - (RETURN - (SEQ (LETT |c| (- |x| |y|) |NNI;subtractIfCan;2$U;3|) - (EXIT (COND - ((< |c| 0) (CONS 1 "failed")) - ('T - (CONS 0 - (|check-subtype| (>= |c| 0) - '(|NonNegativeInteger|) |c|))))))))) + (LET ((|c| (- |x| |y|))) + (COND + ((< |c| 0) (CONS 1 "failed")) + ('T + (CONS 0 + (|check-subtype| (>= |c| 0) '(|NonNegativeInteger|) |c|)))))) (DEFUN |NonNegativeInteger| () (DECLARE (SPECIAL |$ConstructorCache|)) -- cgit v1.2.3