README.md: REPL: add laziness and strictness (#738)

It is not ideal placement, but because of the current CLI design there is no ideal placement at all, except to place implications of every key in its own headline, which would mean to duplicate most of `--help` in README.

#663 already shows that `--help` is not understandable, because currently everything is intermingled.

Further rehashing of README is of course possible, but I see no way to lay-out needed info cleanly (there is a lot of if/else cases) without the redesign of the CLI.
This commit is contained in:
Anton Latukha 2020-10-04 17:29:50 +03:00 committed by GitHub
parent e18d3cc9a2
commit 50c6301b8d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 23 additions and 0 deletions

View File

@ -213,6 +213,29 @@ This also binds the evaluated expression result to the `input` variable, so that
Use the `:help` command for a list of all available REPL commands.
## Nix laziness
Nix is a lazy language with the ability of recursion, so by default REPL and eval prints are lazy:
```
hnix \
--eval \
--expr '{ x = true; }'
{ x = "<CYCLE>"; }
```
To disable laziness add the `--strict` to commands or `:set strict` in the REPL.
```
hnix \
--eval \
# Strictly \
--strict \
--expr '{ x = true; }'
{ x = true; }
```
## Contributing