mirror of
https://github.com/NixOS/nix
synced 2025-07-02 09:21:47 +02:00
docs: split types from syntax (#11013)
move together all syntactic and semantic information into one page, and add a page on data types, which in turn links to the syntax and semantics. also split out the note on scoping rules into its own page. Co-authored-by: Ryan Hendrickson <ryan.hendrickson@alum.mit.edu>
This commit is contained in:
parent
f809edba4f
commit
a713476790
20 changed files with 1029 additions and 935 deletions
14
doc/manual/src/language/scope.md
Normal file
14
doc/manual/src/language/scope.md
Normal file
|
@ -0,0 +1,14 @@
|
|||
# Scoping rules
|
||||
|
||||
Nix is [statically scoped](https://en.wikipedia.org/wiki/Scope_(computer_science)#Lexical_scope), but with multiple scopes and shadowing rules.
|
||||
|
||||
* primary scope: explicitly-bound variables
|
||||
* [`let`](./syntax.md#let-expressions)
|
||||
* [`inherit`](./syntax.md#inheriting-attributes)
|
||||
* [function](./syntax.md#functions) arguments
|
||||
|
||||
* secondary scope: implicitly-bound variables
|
||||
* [`with`](./syntax.md#with-expressions)
|
||||
|
||||
Primary scope takes precedence over secondary scope.
|
||||
See [`with`](./syntax.md#with-expressions) for a detailed example.
|
Loading…
Add table
Add a link
Reference in a new issue