[Nix-dev] Re: New proposal about expression syntax usage.
Michael Raskin
7c6f434c at mail.ru
Wed Aug 15 13:29:05 CEST 2007
apfelmus wrote:
> I'm not sure whether this is a good idea. The advantage of naming the
> arguments explicitly like in
>
> {stdenv, fetchurl, ncurses} : ...
>
> is that nix can check that these and only these arguments are passed to
> the function. I.e. nix performs (does it?) a pattern match on the argument.
But it doesn't check that all of them are used anyway. So when you are
editing a package it is easy to forget to add something to buildInputs
etc. And not being able to pass extra arguments is not such a big plus
per se.
> buildInputs = toList args;
>
> Of course, this assumes that all arguments are derivations and not flags.
And this is not very good. Well, if we add some slow functions inside
Nix (like uniqList) and replace big template.nix with a library function
(like mkDerivation is), we will be able to just use it always and add a
check that args contain no extra parameters.
More information about the nix-dev
mailing list