From a5252c99794a81730b030a8fcc356e1f74537198 Mon Sep 17 00:00:00 2001 From: John Ericson Date: Wed, 8 May 2024 11:18:17 -0400 Subject: [PATCH] doc: Reword scoping section "dynamic scope" is not accurate, so reword. The underlying idea is good however. --- doc/manual/src/language/constructs.md | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/doc/manual/src/language/constructs.md b/doc/manual/src/language/constructs.md index ad1fdfe5f..4d75ea82c 100644 --- a/doc/manual/src/language/constructs.md +++ b/doc/manual/src/language/constructs.md @@ -423,14 +423,15 @@ inline/multi-line, enclosed within `/* ... */`. ## Scoping rules -Nix has constructs with +Nix is [statically scoped](https://en.wikipedia.org/wiki/Scope_(computer_science)#Lexical_scope), but with multiple scopes and shadowing rules. -* dynamic scope - * [`with`](#with-expressions) -* static scope +* primary scope --- explicitly-bound variables * [`let`](#let-expressions) * [`inherit`](#inheriting-attributes) * function arguments -Static scope takes precedence over dynamic scope. +* secondary scope --- implicitly-bound variables + * [`with`](#with-expressions) + +Primary scope takes precedence over secondary scope. See [`with`](#with-expressions) for a detailed example.