diff options
Diffstat (limited to 'tests/012/defset.tl')
-rw-r--r-- | tests/012/defset.tl | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/012/defset.tl b/tests/012/defset.tl index 110f3c64..917c0a9c 100644 --- a/tests/012/defset.tl +++ b/tests/012/defset.tl @@ -19,3 +19,15 @@ (expand '(inc (foo 1 2 :a 3 :b 4) 5)) ^(let ((,%new-val-sym% (+ (foo 1 2 :a 3 :b 4) 5))) (bar 1 2 3 4 () 4 ,%new-val-sym%))) + +(defvarl %data% (vec 0 0 0 0 0 0 0 0 0 1)) +(defun getd (a b c) [%data% (+ a b c)]) +(defun setd (a b c v) (set [%data% (+ a b c)] v)) +(define-accessor getd setd) + +(mtest + (getd 2 3 4) 1 + (set (getd 2 3 4) 2) 2 + [%data% 9] 2 + (inc (getd 2 3 4) 3) 5 + [%data% 9] 5) |