From 2eda11ca28589991471ff3251cccc2471424770e Mon Sep 17 00:00:00 2001 From: David Robillard Date: Wed, 29 Dec 2010 22:50:20 +0000 Subject: Destructuring (i.e. working `match'). git-svn-id: http://svn.drobilla.net/resp/resp@374 ad02d1e2-f140-0410-9f75-f8b11f17cedd --- test/match.resp | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) (limited to 'test') 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)) -- cgit v1.2.1