aboutsummaryrefslogtreecommitdiffstats
path: root/test/match.resp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2010-09-30 12:45:47 +0000
committerDavid Robillard <d@drobilla.net>2010-09-30 12:45:47 +0000
commit0faa00e9dfd221016ad26b5629617949fcce4676 (patch)
tree91ae7796712c83f8a3d9889b97b97ed8c630cfe7 /test/match.resp
parentc5e2f5dbb8922ba9bc5baa8e3194be89cb64f367 (diff)
downloadresp-0faa00e9dfd221016ad26b5629617949fcce4676.tar.gz
resp-0faa00e9dfd221016ad26b5629617949fcce4676.tar.bz2
resp-0faa00e9dfd221016ad26b5629617949fcce4676.zip
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
Diffstat (limited to 'test/match.resp')
-rw-r--r--test/match.resp14
1 files changed, 14 insertions, 0 deletions
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!")