| 26 Jul 2025 |
niklaskorz | but also they would get the warning in addition to the error | 10:02:14 |
emily | but if we have the warning might as well keep both for one more cycle and drop together | 10:02:16 |
niklaskorz | so I don’t think the error has to be reworded | 10:02:21 |
emily | In reply to @niklaskorz:matrix.org but also they would get the warning in addition to the error put the throw first using or | 10:02:26 |
emily | throwIf (!(args.useFetchCargoVendor or true)) | 10:03:11 |
emily | In reply to @niklaskorz:matrix.org so I don’t think the error has to be reworded oh I see | 10:03:39 |
emily | the throw will cause a back trace and stuff though | 10:03:54 |
niklaskorz | no need to change the default value | 10:03:59 |
emily | I'd feel better about having all the info there | 10:04:02 |
emily | not a big deal though | 10:04:05 |
emily | In reply to @niklaskorz:matrix.org no need to change the default value I think the default value breaks ?? actually I guess it probably doesn't | 10:04:23 |
emily | attrsets so weird | 10:04:28 |
emily | anyway do whatever, it's all nitpicking :P | 10:04:40 |
emily | even the warning is automated nitpicking 😆 | 10:04:56 |
niklaskorz | nix-repl> ({ useFetchCargoVendor ? true } @ attrs: attrs ? useFetchCargoVendor) { }
false
nix-repl> ({ useFetchCargoVendor ? true } @ attrs: attrs ? useFetchCargoVendor) { useFetchCargoVendor = true; }
true
| 10:05:23 |
emily | I'm not even sure we should ship it in the final release since it's probably annoying for users with epsilon benefit but meh | 10:05:25 |
emily | right, because attrs is the unprocessed value. brain was just off for a second | 10:05:53 |
niklaskorz | heh it’s a common nix trap I think | 10:06:18 |
emily | In reply to @emilazy:matrix.org we leave a TODO saying to do that and then forget about it (wish: bot that finds # TODO(25.11): and opens issues pinging the author and a tracking issue to group them on branch-off) | 10:07:01 |
niklaskorz | uh where do I put the warnIf without triggering another indentation level... | 10:08:17 |
emily | In reply to @niklaskorz:matrix.org heh it’s a common nix trap I think this is the kind of FP thing that I pride myself on not finding confusing at all so my only excuse is that functions of attrsets are so magical in Nix that I can't think of them as just normal pattern matching :p | 10:08:22 |
emily | (because e.g. you can introspect what a function matches on which is nuts) | 10:08:36 |
emily | In reply to @niklaskorz:matrix.org uh where do I put the warnIf without triggering another indentation level... assert | 10:08:42 |
emily | assert fooIf ... true; is how we add new constructs to the language these days 😅 | 10:09:18 |
emily | we should ideally have things with the true baked in | 10:09:34 |
emily | like assertMsg | 10:09:43 |
emily | assertWarn or something | 10:09:58 |
emily | (hot take: I actually kind of love Nix's keyword foo; bar expression pattern. I wish let did one variable and had no in) | 10:10:54 |
emily | (second wish: do a; b as seq a b so we didn't have to use assert for indentation) | 10:11:50 |
niklaskorz | ok I adjusted the message for the error after all: https://github.com/NixOS/nixpkgs/pull/428565 | 10:15:17 |