Re: [Nix-dev] An issue regarding the default parameters of a function

2016-02-12 Thread Shea Levy
This is intentional: @-capture captures what was actually passed. You can always do something like: let args_ = args // { buildDepends = args.buildDepends or buildDepends; } if you really need this behavior. On 2016-02-12 06:11, Sergey Mironov wrote: > Hi. I have an issue regarding the combinati

Re: [Nix-dev] An issue regarding the default parameters of a function

2016-02-12 Thread Harald van Dijk
On 12/02/2016 12:11, Sergey Mironov wrote: > Hi. I have an issue regarding the combination of two Nix features: > default parameters ( f = {arg ? def } : ...) and arbitrary length > parameters (f = args@{arg, ...} : ...). It looks like they doesn't > work together silently. Here is the example from

Re: [Nix-dev] An issue regarding the default parameters of a function

2016-02-12 Thread Sergey Mironov
Thanks, It is clear. I would also vote for shorter code here. Sergey 2016-02-12 14:21 GMT+03:00 Vladimír Čunát : > Hi. > > On 02/12/2016 12:11 PM, Sergey Mironov wrote: >> I have an issue regarding the combination of two Nix features: >> default parameters ( f = {arg ? def } : ...) and arbitrary

Re: [Nix-dev] An issue regarding the default parameters of a function

2016-02-12 Thread Vladimír Čunát
Hi. On 02/12/2016 12:11 PM, Sergey Mironov wrote: > I have an issue regarding the combination of two Nix features: > default parameters ( f = {arg ? def } : ...) and arbitrary length > parameters (f = args@{arg, ...} : ...). @-pattern binds exactly what was *passed* to the function. Eelco conside

[Nix-dev] An issue regarding the default parameters of a function

2016-02-12 Thread Sergey Mironov
Hi. I have an issue regarding the combination of two Nix features: default parameters ( f = {arg ? def } : ...) and arbitrary length parameters (f = args@{arg, ...} : ...). It looks like they doesn't work together silently. Here is the example from my code. I'd like the function make-nk-parser to t