From 50c6301b8d4eddf5e313838146069b09ad5e580a Mon Sep 17 00:00:00 2001 From: Anton Latukha Date: Sun, 4 Oct 2020 17:29:50 +0300 Subject: [PATCH] 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. --- README.md | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/README.md b/README.md index 3441069..ea93081 100644 --- a/README.md +++ b/README.md @@ -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 = ""; } +``` + +To disable laziness add the `--strict` to commands or `:set strict` in the REPL. + +``` +hnix \ + --eval \ + # Strictly \ + --strict \ + --expr '{ x = true; }' + +{ x = true; } +``` ## Contributing