Open chris-martin opened 6 years ago
Alternatively: Allowing lists in the right-hand position of a dot expression would be less invasive. Actually, something close could be accomplished with no change to the grammar at all, just a slight change to the dict lookup semantics:
meta = let inherit (stdenv.lib) licenses maintainers platforms; in {
description = "Set of integrated tools for the R language";
homepage = http://www.rstudio.com/;
license = licenses.agpl3;
maintainers = maintainers.${[ "ehmry" "changlinli" "ciil" ]};
platforms = platforms.linux;
};
Though more ideally I would like to be able to remove the antiquotes,
meta = let inherit (stdenv.lib) licenses maintainers platforms; in {
description = "Set of integrated tools for the R language";
homepage = http://www.rstudio.com/;
license = licenses.agpl3;
maintainers = maintainers.[ "ehmry" "changlinli" "ciil" ];
platforms = platforms.linux;
};
which I believe could be done without much trouble.
To make "list inheriting" a bit more flexible, and also make list syntax more like dict syntax, we could introduce optional semicolons.
> let x = { a = "1"; b = "2"; }; in [ inherit (x) a b; "3" "4" ]
[ "1" "2" "3" "4" ]
This is starting to get \~weird\~, though, because then lists would be a mixture of space-delimited and semicolon-delimited items.
Antiquotation isn't allowed inside lists yet, so we could use that...
> let x = { a = "1"; b = "2"; }; in [ ${ inherit (x) a b } "3" "4" ]
[ "1" "2" "3" "4" ]
I've decided to go with this:
maintainers = maintainers.[ "ehmry" "changlinli" "ciil" ];
https://twitter.com/chris__martin/status/911280998389878791
As partial compensation for removing
with
(#7), we could introduce a new bit of list syntax which would cover the most revered use case, themaintainers
field in a nix package.This is what a common package
meta
attribute looks like now:Proposing to change it to something like this: