Hi,

On 08/24/2016 12:11 PM, Matan Shenhav wrote:

> I was going through the awesome and illuminating Tour of Nix
> <https://nixcloud.io/tour/> when I bumped into a conundrum in doing exercise 
> 33
> <https://nixcloud.io/tour/?id=33>.
> 
> The 'pick' function is meant to return - in a list - the value of attribute 
> 'at'
> in attribute set 'attset':
> 
>     pick = at: attset: if (attset ? at) then [ attset.at ] else []

That should be:

  pick = at: attset: if (attset ? ${at}) then [ attset.${at} ] else []

Note ${...} around "at". Otherwise it tests for an attribute named "at".

-- 
Eelco Dolstra | LogicBlox, Inc. | http://nixos.org/~eelco/
_______________________________________________
nix-dev mailing list
[email protected]
http://lists.science.uu.nl/mailman/listinfo/nix-dev

Reply via email to