From 463025d43d48944bcd1c63f4146f5d73e66a94d7 Mon Sep 17 00:00:00 2001 From: Pekka Laiho Date: Thu, 4 Jun 2020 17:51:01 +0700 Subject: [PATCH] add not function --- src/Lib/Types.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Lib/Types.php b/src/Lib/Types.php index b7c139c..bf5d808 100644 --- a/src/Lib/Types.php +++ b/src/Lib/Types.php @@ -36,6 +36,10 @@ class Types implements ILib fn (string $a) => new Symbol($a) )); + $env->set('not', new CoreFunc('not', 'Turns true to false and vice versa.', 1, 1, + fn ($a) => !$a + )); + // Test types $env->set('type', new CoreFunc('type', 'Return the type of argument as a string.', 1, 1,