Last change
on this file since 15553 was
15553,
checked in by Mark Evenson, 6 months ago
|
Test for accessing environment locals
|
File size:
470 bytes
|
Line | |
---|
1 | (in-package :cl-user) |
---|
2 | |
---|
3 | (defmacro env-parts (&environment env) |
---|
4 | `(sys::environment-parts ,env)) |
---|
5 | |
---|
6 | (prove:plan 1) |
---|
7 | (prove:is |
---|
8 | (eval |
---|
9 | '(let ((a 10)) |
---|
10 | (env-parts))) |
---|
11 | '((:lexical-variable a 10)) |
---|
12 | "Lexical let binding captures local") |
---|
13 | |
---|
14 | (prove:plan 1) |
---|
15 | (prove:is |
---|
16 | (eval '(let ((b 20)) |
---|
17 | (defun bar () |
---|
18 | (let ((a 10)) (env-parts))) |
---|
19 | (bar))) |
---|
20 | '((:LEXICAL-VARIABLE A 10) (:LEXICAL-VARIABLE B 20)) |
---|
21 | "Nested lexical bindings captures locals") |
---|
22 | |
---|
23 | |
---|
Note: See
TracBrowser
for help on using the repository browser.