aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2010-12-29 22:50:20 +0000
committerDavid Robillard <d@drobilla.net>2010-12-29 22:50:20 +0000
commit2eda11ca28589991471ff3251cccc2471424770e (patch)
treea763edd57dcdcabba3f5eccf5af23f52d90b1eca /test
parent0076c050fb12c92a35b673d63fca82d5cff63bdb (diff)
downloadresp-2eda11ca28589991471ff3251cccc2471424770e.tar.gz
resp-2eda11ca28589991471ff3251cccc2471424770e.tar.bz2
resp-2eda11ca28589991471ff3251cccc2471424770e.zip
Destructuring (i.e. working `match').
git-svn-id: http://svn.drobilla.net/resp/resp@374 ad02d1e2-f140-0410-9f75-f8b11f17cedd
Diffstat (limited to 'test')
-rw-r--r--test/match.resp14
1 files changed, 5 insertions, 9 deletions
diff --git a/test/match.resp b/test/match.resp
index b50257a..0d490ec 100644
--- a/test/match.resp
+++ b/test/match.resp
@@ -1,14 +1,10 @@
(def-type (Shape)
(Circle Float)
- (Square Float)
(Rectangle Float Float))
-(def c1 (Circle 1.0))
-(def c2 (Circle 2.0))
-(def s1 (Square 1.0))
-(def r1 (Rectangle 1.0 1.0))
+(def s1 (Circle 2.0))
+(def s2 (Rectangle 3.0 4.0))
-(match r1
- (Circle r) "Hello, circle!"
- (Square w) "Hello, square!"
- (Rectangle w h) "Hello, rectangle!")
+(match s2
+ (Rectangle w h) (* w h)
+ (Circle r) (* 3.14159 r))