Closed fdietze closed 1 year ago
In https://github.com/tazjin/nix-1p#with-statements
For me, it was a bit confusing what kind of thing with is. What I understood from the current explanation in my own words:
with
with <attr> is an expression which can precede an expression to put all members of into its scope:
with <attr>
nix-repl> let x = 7; attr = {a = 5;}; in x + (with attr; a) 12
However from my experiments with the repl, it only looks like an expression (because it is followed by ;), but it is not.
;
Do you think this change would clarify it? https://cl.tvl.fyi/c/depot/+/8951/
This looks better, thank you!
In https://github.com/tazjin/nix-1p#with-statements
For me, it was a bit confusing what kind of thing
with
is. What I understood from the current explanation in my own words:with <attr>
is an expression which can precede an expression to put all members ofHowever from my experiments with the repl, it only looks like an expression (because it is followed by
;
), but it is not.