Add more functions: null, evenp and oddp

This commit is contained in:
madmaurice 2021-04-02 01:12:22 +02:00
parent 2c8ce149a6
commit 39d791fcf4

View file

@ -102,6 +102,9 @@ my %stdctx = (
print "$e\n";
return undef;
},
'null' => sub { my ($a) = @_; return ! defined $a; },
'evenp' => sub { my ($a) = @_; return ($a % 2 == 0); },
'oddp' => sub { my ($a) = @_; return ($a % 2 != 0); },
'eq' => sub { my ($a, $b) = @_; return ($a eq $b); },
'ne' => sub { my ($a, $b) = @_; return ($a ne $b); },
'==' => sub { my ($a, $b) = @_; return ($a == $b); },