From 31f4966a79feb3ca064106a4b269d6ef62085cbb Mon Sep 17 00:00:00 2001 From: Marshall Lochbaum Date: Wed, 9 Feb 2022 11:02:51 -0500 Subject: =?UTF-8?q?Depth=20=C2=AF1=20doesn't=20really=20indicate=20shadowi?= =?UTF-8?q?ng,=20since=20no=20new=20variable=20is=20created?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- implementation/vm.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'implementation/vm.md') diff --git a/implementation/vm.md b/implementation/vm.md index fd86a00f..50faa7df 100644 --- a/implementation/vm.md +++ b/implementation/vm.md @@ -239,13 +239,13 @@ The compiler takes the source code as `𝕩`. The execution environment is passe - **Runtime**: list of primitive values; see [previous section](#runtime) - **System**: function that takes a list of strings and returns corresponding system values - **Variables**: names of existing variables in the scope -- **Depths**: lexical depth of these variables (default `0`; `¯1` for depth 0 but allowing shadowing) +- **Depths**: lexical depth of these variables (default `0`; `¯1` for depth 0 but allowing redefinition) If `𝕨` has length greater than 4 it's assumed to be the runtime only. If the length is less than 4, empty defaults that don't define any values are used for the missing arguments. The system-value function is passed a list of unique normalized names, meaning that each name is lowercase and contains no underscores. It should return a corresponding list of system values. Because system values are requested on each program run, a function that has access to context such as `•path` can construct appropriate system values on demand. -The variable list is used to create REPLs, but has other uses as well, such as allowing execution to take place within a surrounding scope. It consists of a list of normalized names. The corresponding depth list indicates the lexical depth of each of these, with 0 and -1 indicating that the variable should exist directly in the top-level scope. A typical interactive REPL uses only the value -1, because it allows variables to be shadowed. It maintains a single top-level environment to be used for all evaluations. When the programmer enters a line, it's compiled, then the environment and list of top-level names is extended according to the result. +The variable list is used to create REPLs, but has other uses as well, such as allowing execution to take place within a surrounding scope. It consists of a list of normalized names. The corresponding depth list indicates the lexical depth of each of these, with 0 and -1 indicating that the variable should exist directly in the top-level scope. A typical interactive REPL uses only the value -1, because it allows variables to be redefined—that is, definition with `←` won't fail but instead modify an existing variable. It maintains a single top-level environment to be used for all evaluations. When the programmer enters a line, it's compiled, then the environment and list of top-level names is extended according to the result. ## Assembly -- cgit v1.2.3