From 0faa00e9dfd221016ad26b5629617949fcce4676 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Thu, 30 Sep 2010 12:45:47 +0000 Subject: Preliminary work on algebraic data types and run-time typing. git-svn-id: http://svn.drobilla.net/resp/resp@270 ad02d1e2-f140-0410-9f75-f8b11f17cedd --- test/match.resp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 test/match.resp (limited to 'test') diff --git a/test/match.resp b/test/match.resp new file mode 100644 index 0000000..b50257a --- /dev/null +++ b/test/match.resp @@ -0,0 +1,14 @@ +(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)) + +(match r1 + (Circle r) "Hello, circle!" + (Square w) "Hello, square!" + (Rectangle w h) "Hello, rectangle!") -- cgit v1.2.1