13 lines
288 B
Perl
13 lines
288 B
Perl
|
(let ((a 2))
|
||
|
(let ((a 10))
|
||
|
(expect "Inner variable shadows outer" (= a 10)))
|
||
|
(expect "Outer is not overriden" (= a 2)))
|
||
|
|
||
|
(let ((pings 0))
|
||
|
(defun ping ()
|
||
|
(set pings (+ pings 1)))
|
||
|
|
||
|
(ping) (ping) (ping)
|
||
|
|
||
|
(expect "setting variables in outside context works" (= pings 3)))
|