solutions/A Tour of Nix/10.nix

12 lines
272 B
Nix
Raw Normal View History

2024-04-16 19:13:00 -04:00
let
arguments = {a="f"; b="o"; c="o"; d="bar";}; #only modify this line
func = {a, b, c, ...}: a+b+c;
func2 = args@{a, b, c, ...}: a+b+c+args.d;
in
{
#the argument d is not used
foo = func arguments;
#now the argument d is used
foobar = func2 arguments;
}