Skip to content

Commit 360c0db

Browse files
committed
(docs) improve parent.frames example
1 parent 40662e8 commit 360c0db

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

docs/docs/lips/environments.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -103,22 +103,24 @@ call stack environments.
103103

104104
```scheme
105105
(define (foo)
106-
(define x 10)
106+
(define x 20)
107107
(bar))
108108
109109
(define (bar)
110-
(define x 20)
110+
(define x 30)
111111
(baz))
112112
113113
(define (baz)
114114
(for-each (lambda (env)
115115
(let-env env
116116
(print x)))
117-
;; car is top level environment
118-
(cdr (parent.frames))))
117+
(parent.frames)))
118+
119+
(define x 10)
119120
(foo)
120121
;; ==> 10
121122
;; ==> 20
123+
;; ==> 30
122124
```
123125

124126
You can mix lexical scope chain with frames:

0 commit comments

Comments
 (0)