1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
|
@args -v
Adding variables gives simple user feedback
Lix $VERSION
Type :? for help.
nix-repl> foo = 5
Added foo.
nix-repl> foo = 10
Updated foo.
Optional semicolon at the end, allow setting multiple variables in one line
nix-repl> foo = 2;
Updated foo.
nix-repl> foo = 2; bar = 3;
Updated foo.
Added bar.
String identifiers work
nix-repl> "silly name" = null
Added "silly name".
Attrset syntax works, but without dynamic attrs or merging
nix-repl> foo.bar = "baz"
Updated foo.
nix-repl> foo
{ bar = "baz"; }
nix-repl> foo."this works" = 42
Updated foo.
nix-repl> foo
{ "this works" = 42; }
nix-repl> foo.bar = "baz"; foo.more = "error"
error: attribute 'foo' already defined at «string»:1:18
at «string»:1:12:
1| foo.bar = "baz"; foo.more = "error"
| ^
nix-repl> ${foo} = 10
error: dynamic attributes not allowed in REPL
at «string»:1:1:
1| ${foo} = 10
| ^
|