Add '19.nix'

This commit is contained in:
NaiJi ✨ 2022-04-15 12:57:00 +00:00
parent c39c67ea01
commit 7f19b85a40
1 changed files with 21 additions and 0 deletions

21
19.nix Normal file
View File

@ -0,0 +1,21 @@
let
attrSet = {x = "a"; y = "b"; b = {t = true; f = false;};};
attrSet.c = 1;
attrSet.d = null;
attrSet.e.f = "g";
in
rec {
#boolean
ex0 = attrSet.b.t;
#equal
ex01 = "a" == attrSet.x;
#unequal
ex02 = !("b" != attrSet.y );
#and/or/neg
ex03 = ex01 && !ex02 || ! attrSet.b.f;
#implication
ex04 = true -> attrSet.b.t;
#contains attribute
ex05 = attrSet ? x;
ex06 = attrSet.b ? f;
}