shen/release/test_programs/calculator.shen in shen-ruby-0.12.1 vs shen/release/test_programs/calculator.shen in shen-ruby-0.13.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)
+
+
+