summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorChris Martin <ch.martin@gmail.com>2017-10-09 18:51:02 -0400
committerChris Martin <ch.martin@gmail.com>2017-10-09 18:51:02 -0400
commit667cbfe2ba105858f2dabb55f0772c6769a2323a (patch)
tree0e5df4da05d36ea763ed0055bb4e6b0c835125dc
parent7415df00770a39509c23e08c79345c53eefe4b8a (diff)
[nix/en] document using ? to test set membership
-rw-r--r--nix.html.markdown6
1 files changed, 6 insertions, 0 deletions
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; }