summaryrefslogtreecommitdiff
path: root/match.lisp
diff options
context:
space:
mode:
authortomsmeding <tom.smeding@gmail.com>2017-12-09 10:48:58 +0100
committertomsmeding <tom.smeding@gmail.com>2017-12-09 10:48:58 +0100
commit897fb17dd6a045a7056e6d6babbbb24748f698f6 (patch)
tree65f0659483ba2239d07e30b3547379625f5b5cae /match.lisp
Initial
Diffstat (limited to 'match.lisp')
-rw-r--r--match.lisp15
1 files changed, 15 insertions, 0 deletions
diff --git a/match.lisp b/match.lisp
new file mode 100644
index 0000000..84503e0
--- /dev/null
+++ b/match.lisp
@@ -0,0 +1,15 @@
+(define f (x)
+ (match x
+ ((1 2 3) "1-2-3")
+ ((1) "just 1")
+ ((1 ...) "1 something")
+ ((n ...) "number something")
+ ('v "something quoted")
+ "dunno"))
+
+(print (f '(1 2 3)))
+(print (f '(1)))
+(print (f '(1 2 3 4 5)))
+(print (f '(2 3 4 5)))
+(print (f ''"kaas"))
+(print (f "kaas"))