From 7f19b85a40bbf434c39e146a3ca617a3a39c2ef5 Mon Sep 17 00:00:00 2001 From: NaiJi Date: Fri, 15 Apr 2022 12:57:00 +0000 Subject: [PATCH] Add '19.nix' --- 19.nix | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 19.nix diff --git a/19.nix b/19.nix new file mode 100644 index 0000000..c889db8 --- /dev/null +++ b/19.nix @@ -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; +} \ No newline at end of file