mirror of
https://github.com/privatevoid-net/nix-super.git
synced 2024-11-25 07:16:17 +02:00
doc: Reword scoping section
"dynamic scope" is not accurate, so reword. The underlying idea is good however.
This commit is contained in:
parent
460d8fbaea
commit
a5252c9979
1 changed files with 6 additions and 5 deletions
|
@ -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.
|
||||
|
|
Loading…
Reference in a new issue