Skip to content

Commit 5b3a3cc

Browse files
committed
Rename scoping -> scopeanalyzer, more descriptive.
1 parent 7724f92 commit 5b3a3cc

File tree

5 files changed

+4
-4
lines changed

5 files changed

+4
-4
lines changed

HACKING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ To study a particular feature, just start from the entry point, and follow the d
9292

9393
The `lazify` and `continuations` macros are the most complex parts. As for the lazifier, grep also for `passthrough_lazy_args` and `maybe_force_args`. As for continuations, read the `tco` macro first, and keep in mind how that works when reading `continuations`.
9494

95-
`unpythonic.syntax.scoping` is a unfortunate artifact that is needed to implement macros that interact with Python's scoping rules, notably `let`.
95+
`unpythonic.syntax.scopeanalyzer` is a unfortunate artifact that is needed to implement macros that interact with Python's scoping rules, notably `let`.
9696

9797
As of the second half of 2020, the main target platform is Python 3.6, both **CPython** and **PyPy3**. The code should run on 3.4 or any later Python. We have [a GitHub workflow](https://github.com/Technologicat/unpythonic/actions?query=workflow%3A%22Python+package%22) that runs the test suite
9898

doc/macros.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -840,7 +840,7 @@ because now at the time when ``b`` is forced, the name ``a`` still points to the
840840

841841
If you're sure you have *new definitions* and not *imperative updates*, just manually use ``lazy[]`` (or ``lazyrec[]``, as appropriate) on the RHS. Or if it's fine to use eager evaluation, just omit the ``lazy[]``, thus allowing Python to evaluate the RHS immediately.
842842

843-
Beside function calls (which bind the parameters of the callee to the argument values of the call) and assignments, there are many other binding constructs in Python. For a full list, see [here](http://excess.org/article/2014/04/bar-foo/), or locally [here](../unpythonic/syntax/scoping.py), in function ``get_names_in_store_context``. Particularly noteworthy in the context of lazification are the ``for`` loop and the ``with`` context manager.
843+
Beside function calls (which bind the parameters of the callee to the argument values of the call) and assignments, there are many other binding constructs in Python. For a full list, see [here](http://excess.org/article/2014/04/bar-foo/), or locally [here](../unpythonic/syntax/scopeanalyzer.py), in function ``get_names_in_store_context``. Particularly noteworthy in the context of lazification are the ``for`` loop and the ``with`` context manager.
844844

845845
In Python's ``for``, the loop counter is an imperatively updated single name. In many use cases a rapid update is desirable for performance reasons, and in any case, the whole point of the loop is (almost always) to read the counter (and do something with the value) at least once per iteration. So it is much simpler, faster, and equally correct not to lazify there.
846846

unpythonic/syntax/lazify.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ def is_literal_container(tree, maps_only=False):
193193
# - keep in mind that force(x) == x if x is a non-promise atom, so a wrapper is not needed
194194
# - don't lazify "with", eager init is the whole point of a context manager
195195
# - don't lazify "for", the loop counter changes value imperatively (and usually rather rapidly)
196-
# full list: see unpythonic.syntax.scoping.get_names_in_store_context (and the link therein)
196+
# full list: see unpythonic.syntax.scopeanalyzer.get_names_in_store_context (and the link therein)
197197

198198
def lazify(body):
199199
# first pass, outside-in

unpythonic/syntax/letdo.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
from ..dynassign import dyn
3333
from ..misc import namelambda
3434

35-
from .scoping import scoped_walker
35+
from .scopeanalyzer import scoped_walker
3636
from .letdoutil import isenvassign, UnexpandedEnvAssignView
3737

3838
def let(bindings, body):

0 commit comments

Comments
 (0)