1
0
mirror of https://github.com/adambard/learnxinyminutes-docs.git synced 2025-08-06 23:06:49 +02:00

Merge pull request #2902 from chris-martin/nix-question-mark

[nix/en] document using ? to test set membership
This commit is contained in:
Andre Polykanine A.K.A. Menelion Elensúlë
2017-10-10 02:14:19 +03:00
committed by GitHub

View File

@@ -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; }