aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/match.resp7
1 files changed, 4 insertions, 3 deletions
diff --git a/test/match.resp b/test/match.resp
index 83ea505..0df0568 100644
--- a/test/match.resp
+++ b/test/match.resp
@@ -1,12 +1,13 @@
+; A Shape is either a Circle (w/ radius) or a Rectangle (w/ width/height)
(def-type (Shape)
(Circle Float)
(Rectangle Float Float))
+; Return the area of s
(def (area s)
(match s
- (Rectangle w h) (* w h)
- (Circle r) (* 3.14159 r)))
-
+ (Rectangle w h) (* w h)
+ (Circle r) (* 3.14159 r)))
(def s (Rectangle 3.0 4.0))