From 772093ace7bc29041b9f8338829960d55ff366f7 Mon Sep 17 00:00:00 2001 From: RGBCube Date: Fri, 6 Jun 2025 23:54:15 +0300 Subject: [PATCH] blog(nix-iceberg): explain `set.a or "mewo" is set-specific` --- site/blog/2024-04-15-nix-iceberg.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/site/blog/2024-04-15-nix-iceberg.md b/site/blog/2024-04-15-nix-iceberg.md index b02bb18..e79f523 100644 --- a/site/blog/2024-04-15-nix-iceberg.md +++ b/site/blog/2024-04-15-nix-iceberg.md @@ -581,7 +581,13 @@ It was created by [t184256](https://github.com/t184256) on GitHub, here is the ## `set.a or "meow"` is set-specific -TODO +[As mentioned previously,](#let-a-1-or-6-in-a-or-9-) the Nix parser is weird and +treats `or` as an identifier when it is not right after an attribute selection +expression. + +So, the `or` in `set.key or default` is the keyword, but in `set or default` it +is not, and the latter expression is actually a double function application, +where we apply `or` to `set`, and then `default` to the result of that. ## `builtins.toString [true false true] == "1 1"`