From 667cbfe2ba105858f2dabb55f0772c6769a2323a Mon Sep 17 00:00:00 2001 From: Chris Martin Date: Mon, 9 Oct 2017 18:51:02 -0400 Subject: [nix/en] document using ? to test set membership --- nix.html.markdown | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'nix.html.markdown') diff --git a/nix.html.markdown b/nix.html.markdown index ef59a135..ba122a46 100644 --- a/nix.html.markdown +++ b/nix.html.markdown @@ -208,6 +208,12 @@ with builtins; [ { a = 1; b = 2; }.a #=> 1 + # The ? operator tests whether a key is present in a set. + ({ a = 1; b = 2; } ? a) + #=> true + ({ a = 1; b = 2; } ? c) + #=> false + # The // operator merges two sets. ({ a = 1; } // { b = 2; }) #=> { a = 1; b = 2; } -- cgit v1.2.3