#python #sicp
This discipline of sharing names among nested
definitions is called lexical scoping. Critically, the inner functions have
access to the names in the environment where they are defined (not where they
are called).
If you want to change selection, open document below and click on "Move attachment"
1.6 Higher-Order Functionsed.
Lexical scope. Locally defined functions also have access to the name
bindings in the scope in which they are defined. In this example,
sqrt_update refers to the name a , which is a formal parameter of its
enclosing function sqrt . <span>This discipline of sharing names among nested
definitions is called lexical scoping. Critically, the inner functions have
access to the names in the environment where they are defined (not where they
are called).
We require two extensions to our environment model to enable lexical scoping.
Each user-defined function has a parent environment: the environment in
which it was defined. When a us Summary
status | not read | | reprioritisations | |
---|
last reprioritisation on | | | suggested re-reading day | |
---|
started reading on | | | finished reading on | |
---|
Details