aboutsummaryrefslogtreecommitdiffstats
path: root/test/quote.scm
diff options
context:
space:
mode:
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