!tDnwWRNkmmYtMXfaZl:nixos.org

Nix Language

1519 Members
Nix programming language267 Servers

Load older messages


SenderMessageTime
28 Sep 2024
@tazjin:matrix.orgtazjin aleksana (force me to bed after 18:00 UTC): you can get the value! 11:35:25
@tazjin:matrix.orgtazjin just inherit it back out :) 11:35:46
@aleksana:mozilla.orgaleksana (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:matrix.orgtazjin
nix-repl> if = 1

nix-repl> { inherit "if"; }."if"
1
11:41:58
@tazjin:matrix.orgtazjinthis works with basically any wonky identifiers11:42:09
@aleksana:mozilla.orgaleksana (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:fem.ggcafkafk 🏳️‍⚧️
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
@emilazy:matrix.orgemily
nix-repl> with { "if" = 123; }; { inherit "if"; }."if"
123
12:11:18
@emilazy:matrix.orgemilywe have raw identifier syntax at home12:11:21
@emilazy:matrix.orgemily error: dynamic attributes not allowed in inherit boo 12:12:02
@cafkafk:fem.ggcafkafk 🏳️‍⚧️

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:fem.ggcafkafk 🏳️‍⚧️still haven't fully come to terms with this12:14:48
@tazjin:matrix.orgtazjin
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
@1saifj:matrix.orgSaif Aljanahi joined the room.14:55:04
@m1-s:matrix.org@m1-s:matrix.org left the room.20:46:10
@libregeekingkid:matrix.orgrajudev joined the room.22:10:51
@larstvei:matrix.org@larstvei:matrix.org changed their display name from Lars Tveito to larstvei.23:09:52
29 Sep 2024
@lineararray:matrix.orgLinearArray changed their profile picture.05:04:17
@swarsel:swatrix.swarsel.winswarsel joined the room.11:31:55
@mrdev023:matrix.orgmrdev023 left the room.14:06:25
@mrdev023:matrix.orgmrdev023 joined the room.14:07:31
@freopen:matrix.orgfreopen joined the room.20:42:07
30 Sep 2024
@aleksana:mozilla.orgaleksana (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:matrix.orgtazjin aleksana (force me to bed after 18:00 UTC): do you mean "how is this implemented in C++ Nix?" ? 09:53:29
@tazjin:matrix.orgtazjinhttps://github.com/NixOS/nix/blob/a1415471b8fef107b4ee3eb87ab0946b90331d57/src/libcmd/repl.cc#L679-L690 it's here 09:53:31
@larstvei:matrix.org@larstvei:matrix.org left the room.10:02:23
1 Oct 2024
@bishop365:matrix.orgbishop365 left the room.11:58:50
@bishop365:matrix.orgbishop365 joined the room.12:01:28
@techmiker:matrix.orgTechMiker changed their display name from Mike Rossiter to TechMiker.15:38:30
@-_o:matrix.org-_o joined the room.20:55:50

Show newer messages


Back to Room ListRoom Version: 6