Add string comparison functions
This commit is contained in:
parent
368e1be5c6
commit
855f4fef5f
1 changed files with 12 additions and 0 deletions
|
@ -109,6 +109,18 @@ my %stdctx = (
|
|||
'ne' => sub { my ($a, $b) = @_; return ($a ne $b); },
|
||||
'==' => sub { my ($a, $b) = @_; return ($a == $b); },
|
||||
'!=' => sub { my ($a, $b) = @_; return ($a != $b); },
|
||||
'string=' => sub { my ($a, $b) = @_; return ($a eq $b); },
|
||||
'string/=' => sub { my ($a, $b) = @_; return ($a ne $b); },
|
||||
'string<' => sub { my ($a, $b) = @_; return ($a lt $b); },
|
||||
'string>' => sub { my ($a, $b) = @_; return ($a gt $b); },
|
||||
'string<=' => sub { my ($a, $b) = @_; return !($a gt $b); },
|
||||
'string>=' => sub { my ($a, $b) = @_; return !($a lt $b); },
|
||||
'string-equal' => sub { my ($a, $b) = @_; return ( lc($a) eq lc($b)); },
|
||||
'string-not-equal' => sub { my ($a, $b) = @_; return (lc($a) ne lc($b)); },
|
||||
'string-lessp' => sub { my ($a, $b) = @_; return (lc($a) lt lc($b)); },
|
||||
'string-greaterp' => sub { my ($a, $b) = @_; return (lc($a) gt lc($b)); },
|
||||
'string-not-greaterp' => sub { my ($a, $b) = @_; return !(lc($a) gt lc($b)); },
|
||||
'string-not-lessp' => sub { my ($a, $b) = @_; return !(lc($a) lt lc($b)); },
|
||||
'>' => sub { my ($a,$b) = @_; return ($a > $b); },
|
||||
'<' => sub { my ($a,$b) = @_; return ($a < $b); },
|
||||
'>=' => sub { my ($a,$b) = @_; return ($a >= $b); },
|
||||
|
|
Loading…
Reference in a new issue