From 3b253b7acaa544d869a1eaebd4fe1d24ddef20a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jens=20Axel=20S=C3=B8gaard?= Date: Sun, 7 Apr 2013 14:11:04 +0200 Subject: [PATCH] Fixed bug: Multiplication of lists now work --- bracket/bracket.rkt | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/bracket/bracket.rkt b/bracket/bracket.rkt index 26fdba524..065d751f5 100644 --- a/bracket/bracket.rkt +++ b/bracket/bracket.rkt @@ -394,7 +394,7 @@ (define/memo (simplify-times ops) ;(displayln (list 'simplify-times ops)) - ; the operands os are simplified + ; the operands ops are simplified ; (Times op1 op2 op ...) ; - n-ary, n>=2 ; - no operands are products @@ -439,8 +439,10 @@ [(and (list-expression? u1) (list-expression? u2) (= (length u1) (length u2))) (construct - 'List (append-map (λ (u1i u2i) (simplify-times-rec (list u1i u2i))) - (operands u1) (operands u2)))] + 'List (map + (λ (u1i u2i) + (construct 'Times (simplify-times-rec (list u1i u2i)))) + (operands u1) (operands u2)))] [(and (list-expression? u1) (list-expression? u2)) ; lists of different lengths => do nothing (list u1 u2)] @@ -895,7 +897,7 @@ (Expand-product (Expand v) (Expand (Quotient u v)))) (Expand-product (Expand v) - (Expand (Quotient u v)))] + (Expand (Quotient u v)))] [(Power) (define base (Operand u 0)) (define exponent (Operand u 1))