summaryrefslogtreecommitdiff
path: root/tests/clos4.bth
blob: c9a20925ec7361396aa8b8aa3eb5e716061aad34 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
(defn (f)
	(let (a 0)
		(defn (s x) (set a x))
		(defn (g) a)
		[s g]))


(def a1 (f))
(def s1 (a1 0))
(def g1 (a1 1))

(def a2 (f))
(def s2 (a2 0))
(def g2 (a2 1))

(say (g1))
(say (g2))

(s1 6)
(say (g1))
(say (g2))

(s2 70)
(say (g1))
(say (g2))

(s2 (* (g1) (g1)))
(say (g1))
(say (g2))