diff options
author | Aspen Smith <root@gws.fyi> | 2024-07-05T03·46-0400 |
---|---|---|
committer | clbot <clbot@tvl.fyi> | 2024-07-05T16·40+0000 |
commit | fc63594631590547c9a31001806095f2e079a20e (patch) | |
tree | bed08e994d56fb224a62be6ab371f9cd1fec17e6 /tvix/cli/Cargo.toml | |
parent | ac3d717944412b17d7dcd18006c2f9f522b1b3f7 (diff) |
feat(tvix/repl): Allow binding variables at the top-level r/8346
Allow binding variables at the REPL's toplevel in the same way the Nix REPL does, using the syntax <ident> = <expr>. This fully, strictly evaluates the value and sets it in the repl's "env", which gets passed in at the toplevel when evaluating expressions. The laziness behavior differs from Nix's, but I think this is good: ❯ nix repl Welcome to Nix version 2.3.18. Type :? for help. nix-repl> x = builtins.trace "x" 1 nix-repl> x trace: x 1 nix-repl> x 1 vs tvix: tvix-repl> x = builtins.trace "x" 1 trace: "x" :: string tvix-repl> x => 1 :: int tvix-repl> x => 1 :: int Bug: https://b.tvl.fyi/issues/371 Change-Id: Ieb2d626b7195fa87be638c9a4dae2eee45eb9ab1 Reviewed-on: https://cl.tvl.fyi/c/depot/+/11954 Reviewed-by: flokli <flokli@flokli.de> Tested-by: BuildkiteCI Autosubmit: aspen <root@gws.fyi>
Diffstat (limited to 'tvix/cli/Cargo.toml')
-rw-r--r-- | tvix/cli/Cargo.toml | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/tvix/cli/Cargo.toml b/tvix/cli/Cargo.toml index 644393a7c4ed..f6d03ce5ab8f 100644 --- a/tvix/cli/Cargo.toml +++ b/tvix/cli/Cargo.toml @@ -20,6 +20,8 @@ clap = { version = "4.0", features = ["derive", "env"] } dirs = "4.0.0" rustyline = "10.0.0" rnix = "0.11.0" +rowan = "*" +smol_str = "0.2.0" thiserror = "1.0.38" tokio = "1.28.0" tracing = "0.1.40" |