shen/release/test_programs/calculator.shen in shen-ruby-0.10.0 vs shen/release/test_programs/calculator.shen in shen-ruby-0.11.0

- old
+ new

@@ -1,21 +1,21 @@ -(datatype arith-expr - - X : number; - ==================== - [num X] : arith-expr; - - if (element? Op [+ - * /]) - X : arith-expr; Y : arith-expr; - =============================== - [X Op Y] : arith-expr;) - -(define do-calculation - {arith-expr --> number} - [X + Y] -> (+ (do-calculation X) (do-calculation Y)) - [X - Y] -> (- (do-calculation X) (do-calculation Y)) - [X * Y] -> (* (do-calculation X) (do-calculation Y)) - [X / Y] -> (/ (do-calculation X) (do-calculation Y)) - [num X] -> X) - - - +(datatype arith-expr + + X : number; + ==================== + [num X] : arith-expr; + + if (element? Op [+ - * /]) + X : arith-expr; Y : arith-expr; + =============================== + [X Op Y] : arith-expr;) + +(define do-calculation + {arith-expr --> number} + [X + Y] -> (+ (do-calculation X) (do-calculation Y)) + [X - Y] -> (- (do-calculation X) (do-calculation Y)) + [X * Y] -> (* (do-calculation X) (do-calculation Y)) + [X / Y] -> (/ (do-calculation X) (do-calculation Y)) + [num X] -> X) + + +