aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2012-12-17 03:35:53 +0000
committerDavid Robillard <d@drobilla.net>2012-12-17 03:35:53 +0000
commit0375a20786f1e6eba9d128889f700b22d447021c (patch)
tree257649c81d9e8c9779d412ffa12ef68738d40831 /test
parentd3708205163f784343733661d9fa01ff14f8b751 (diff)
downloadresp-0375a20786f1e6eba9d128889f700b22d447021c.tar.gz
resp-0375a20786f1e6eba9d128889f700b22d447021c.tar.bz2
resp-0375a20786f1e6eba9d128889f700b22d447021c.zip
Fix calling functions that lexically enclose the current function.
In particular this makes it possible to walk lists with match, since match clauses expand to fns. git-svn-id: http://svn.drobilla.net/resp/trunk@441 ad02d1e2-f140-0410-9f75-f8b11f17cedd
Diffstat (limited to 'test')
-rw-r--r--test/quote.resp27
1 files changed, 13 insertions, 14 deletions
diff --git a/test/quote.resp b/test/quote.resp
index 741a7a7..638e81b 100644
--- a/test/quote.resp
+++ b/test/quote.resp
@@ -5,21 +5,20 @@
(Empty))
-(def l (quote (2 3)))
+(def list (quote (2 a b c)))
-(match l
- (Symbol s)
- 0
+(def (len l)
+ (match l
+ (Symbol s)
+ 1
- (Int i)
- 1
+ (Int i)
+ 1
- (List h t)
- 2
-
- (Empty)
- 3)
+ (List h t)
+ (+ 1 (len t))
+
+ (Empty)
+ 0))
-;(def (car l)
-;(. l 0)
-;l
+(len list) \ No newline at end of file