28 Sep 2024 |
cafkafk 🏳️⚧️ | seems like a repl'ism? | 02:50:40 |
aleksana (force me to bed after 18:00 UTC) | The lexer.l just shows keywords take a higher precedence than identifiers | 02:50:56 |
cafkafk 🏳️⚧️ | * seems like a repl'ism? (specially because nix-instantiate --parse --expr 'if = 1' also fails) | 02:51:37 |
cafkafk 🏳️⚧️ | Do you know what part of the code let's you do assignment without let bindings in the repl, I feel like that's a good place to look for this | 02:54:29 |
cafkafk 🏳️⚧️ | Maybe if isVarName denylisted keywords it wouldn't happen? | 02:58:11 |
tazjin | aleksana (force me to bed after 18:00 UTC): you can get the value! | 11:35:25 |
tazjin | just inherit it back out :) | 11:35:46 |
aleksana (force me to bed after 18:00 UTC) | In reply to @tazjin:matrix.org just inherit it back out :) How's that? | 11:36:39 |
tazjin | nix-repl> if = 1
nix-repl> { inherit "if"; }."if"
1
| 11:41:58 |
tazjin | this works with basically any wonky identifiers | 11:42:09 |
aleksana (force me to bed after 18:00 UTC) | ...just knew that inherit can be suffixed with a string instead of identifier... | 11:43:41 |
cafkafk 🏳️⚧️ | In reply to @tazjin:matrix.org
nix-repl> if = 1
nix-repl> { inherit "if"; }."if"
1
I love this language so much | 12:10:59 |
emily | nix-repl> with { "if" = 123; }; { inherit "if"; }."if"
123
| 12:11:18 |
emily | we have raw identifier syntax at home | 12:11:21 |
emily | error: dynamic attributes not allowed in inherit boo | 12:12:02 |
cafkafk 🏳️⚧️ | speaking of boo, just saw
warning: let { found at «string»:1:1. This feature is deprecated and will be removed in the future. Use --extra-deprecated-features ancient-let to silence this warning.
| 12:14:23 |
cafkafk 🏳️⚧️ | still haven't fully come to terms with this | 12:14:48 |
tazjin | In reply to @emilazy:matrix.org
error: dynamic attributes not allowed in inherit boo try implementing a nix evaluator and you'll find out why, btw :) | 14:20:18 |
| Saif Aljanahi joined the room. | 14:55:04 |
| @m1-s:matrix.org left the room. | 20:46:10 |
| rajudev joined the room. | 22:10:51 |
| @larstvei:matrix.org changed their display name from Lars Tveito to larstvei. | 23:09:52 |
29 Sep 2024 |
| LinearArray changed their profile picture. | 05:04:17 |
| swarsel joined the room. | 11:31:55 |
| mrdev023 left the room. | 14:06:25 |
| mrdev023 joined the room. | 14:07:31 |
| freopen joined the room. | 20:42:07 |
30 Sep 2024 |
aleksana (force me to bed after 18:00 UTC) | In reply to @aleksana:mozilla.org Why is repl allowing if = 1 (can autocomplete if but can't get the value) but not a = { if = 1; } ? I gotta know why, the raw assignment expression can't exist alone in the file, so there's a hack in repl to make it work | 06:45:01 |
tazjin | aleksana (force me to bed after 18:00 UTC): do you mean "how is this implemented in C++ Nix?" ? | 09:53:29 |
tazjin | https://github.com/NixOS/nix/blob/a1415471b8fef107b4ee3eb87ab0946b90331d57/src/libcmd/repl.cc#L679-L690 it's here | 09:53:31 |