[Nix-dev] @ and default arguments

Eelco Dolstra e.dolstra at tudelft.nl
Fri Aug 27 13:03:28 CEST 2010


Hi,

On 08/25/2010 11:36 PM, Yury G. Kudryashov wrote:

> The following returns false:
> 
> (a@{ b ? true }: a ? b) { }
> 
> It seems that after a@{...} a is not populated by default values. Is it a 
> bug, or a feature?

This is the intended behaviour.  The fact that there is a "{b ? true}" does not
cause an attribute to be "added" to the passed argument set ("a"), it merely
causes a "b" with value "true" to be added to the lexical scope.

-- 
Eelco Dolstra | http://www.st.ewi.tudelft.nl/~dolstra/



More information about the nix-dev mailing list