| 10 Jun 2026 |
K900 | And yes, it composes | 07:13:28 |
K900 | ~
❯ nix-instantiate --eval --expr '{ stuff = [ { number = "one"; } { number = "two"; } { number = "three"; } ]; }' -A stuff.0.number
"one"
| 07:13:31 |
K900 | Someone update the iceberg | 07:13:39 |
| @eirikwit:pvv.ntnu.no joined the room. | 08:01:18 |
| @eirikwit:pvv.ntnu.no left the room. | 08:02:47 |
Acid Bong | In reply to @k900:0upti.me
~
❯ nix-instantiate --eval --expr '{ stuff = [ { number = "one"; } { number = "two"; } { number = "three"; } ]; }' -A stuff.0.number
"one"
what in the nushell | 08:05:35 |
| @zooter9:matrix.org left the room. | 10:00:19 |
K900 | To be clear none of this is nushell | 14:27:42 |
K900 | This is all well-defined nix-instantiate (and other things that support -A) behavior | 14:27:58 |
Acid Bong | ik, just Nu is the only lang i know where accessing by number is done the same way as accessing by attr | 15:31:00 |
piegames | Lol | 15:44:50 |
piegames | I think this is unsound? | 15:44:57 |
piegames | Or at least, it is type-dependant, because it could be an attribute named "0" instead | 15:45:32 |
jyrama | Sounds very YAML to me. Sometimes you just cannot decide if no mean no, ie. false or Norway. Not fan of ambiguous types. | 18:50:21 |
K900 | ~
❯ nix-instantiate --eval --expr '{ "0" = [ 0 1 2 ]; }' -A 0.0
error: the expression selected by the selection path '0.0' should be a list but is a set: { "0" = «thunk»; }
| 19:24:05 |
K900 | Nope if it's a number it's just a number always | 19:24:07 |
K900 | ~
❯ nix-instantiate --eval --expr '{ "0" = [ 0 1 2 ]; }' -A '"0".0'
error: the expression selected by the selection path '"0".0' should be a list but is a set: { "0" = «thunk»; }
| 19:24:20 |
| boomi123 joined the room. | 19:25:51 |
toonn | Isn't 0 an attrName that always needs to be quoted? | 19:40:33 |
K900 | The second example does have it quoted | 19:41:05 |
K900 | And it's still failing | 19:41:09 |
K900 | So no, this specific path lookup is just weirdly special | 19:41:20 |
| David joined the room. | 22:43:38 |
| 11 Jun 2026 |
Kris Shannon | Yeah the parsing of the attribute path splits it into a list of strings but as part of that throws away any knowledge of quoting. All that the quoting does is allow you to have empty path components or components containing periods. | 20:27:06 |
| 12 Jun 2026 |
| DontBlameMe joined the room. | 16:25:57 |
| 13 Jun 2026 |
| debtquity set a profile picture. | 03:21:36 |
| debtquity removed their profile picture. | 03:21:41 |
| debtquity set a profile picture. | 03:22:46 |
| Pengo joined the room. | 04:59:34 |
| kokosa joined the room. | 06:21:41 |