From 6cf5e57e0adb30ae115be4dd7ca73462b9a3c2dd Mon Sep 17 00:00:00 2001 From: Benedikt Seidl Date: Fri, 25 Nov 2022 11:28:19 +0100 Subject: [PATCH 1/2] Remove superfluous print command --- src/ch05-03-imports-and-callpackage.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/ch05-03-imports-and-callpackage.md b/src/ch05-03-imports-and-callpackage.md index 931c0e9..b94f052 100644 --- a/src/ch05-03-imports-and-callpackage.md +++ b/src/ch05-03-imports-and-callpackage.md @@ -9,13 +9,13 @@ then it will assume `/default.nix` was the desired file. $ cat data.nix { a = "foo"; b = "bar"; } -nix-repl> :p import ./data.nix +nix-repl> import ./data.nix { a = "foo"; b = "bar"; } $ cat expression.nix 5+2 -nix-repl> :p import ./expression.nix +nix-repl> import ./expression.nix 7 ``` @@ -24,7 +24,7 @@ This still extends to functions: $ cat function.nix { x, y }: x + y -nix-repl> :p import ./function.nix { x = 2; y = 9; } +nix-repl> import ./function.nix { x = 2; y = 9; } 11 ``` From a78fdaccfd4185bf85772dc485a0a965da029bc5 Mon Sep 17 00:00:00 2001 From: Benedikt Seidl Date: Fri, 25 Nov 2022 11:39:17 +0100 Subject: [PATCH 2/2] Remove :p command :p command is not explained or introduced --- src/ch05-01-language-basics.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ch05-01-language-basics.md b/src/ch05-01-language-basics.md index 6b6d223..66a79ac 100644 --- a/src/ch05-01-language-basics.md +++ b/src/ch05-01-language-basics.md @@ -72,8 +72,8 @@ nix-repl> a.count 5 # Shorthand for nested attribute sets -nix-repl> :p { foo.bar.baz = 1; foo.bar.buzz = 2; } -{ foo = { bar = { baz = 1; buzz = 2; }; }; } +nix-repl> { foo.bar.baz = 1; foo.bar.buzz = 2; } == { foo = { bar = { baz = 1; buzz = 2; }; }; } +true ``` You will commonly see empty attr sets in nixpkgs, an example being: