aboutsummaryrefslogtreecommitdiffstats
path: root/test/quote.scm
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2012-12-23 05:31:15 +0000
committerDavid Robillard <d@drobilla.net>2012-12-23 05:31:15 +0000
commit67319bf0410196787c753225f46057bc7c94beec (patch)
tree572e8f8989a903fde8be784de5dddbaa1938ecfe /test/quote.scm
parent0375a20786f1e6eba9d128889f700b22d447021c (diff)
downloadresp-67319bf0410196787c753225f46057bc7c94beec.tar.gz
resp-67319bf0410196787c753225f46057bc7c94beec.tar.bz2
resp-67319bf0410196787c753225f46057bc7c94beec.zip
Move towards standard Scheme syntax.
git-svn-id: http://svn.drobilla.net/resp/trunk@442 ad02d1e2-f140-0410-9f75-f8b11f17cedd
Diffstat (limited to 'test/quote.scm')
-rw-r--r--test/quote.scm24
1 files changed, 24 insertions, 0 deletions
diff --git a/test/quote.scm b/test/quote.scm
new file mode 100644
index 0000000..4895d2e
--- /dev/null
+++ b/test/quote.scm
@@ -0,0 +1,24 @@
+(def-type (Expr)
+ (Symbol Symbol)
+ (Int Int)
+ (List Expr Expr)
+ (Empty))
+
+
+(define list (quote (2 a b c)))
+
+(define (len l)
+ (match l
+ (Symbol s)
+ 1
+
+ (Int i)
+ 1
+
+ (List h t)
+ (+ 1 (len t))
+
+ (Empty)
+ 0))
+
+(len list) \ No newline at end of file