Skip to content

Instantly share code, notes, and snippets.

View gist:147925
Perl> undef == 10;
Use of uninitialized value in numeric eq (==) at (eval 2) line 3.
Perl> undef > 10;
Use of uninitialized value in numeric gt (>) at (eval 3) line 3.
Perl> undef < 10;
Warning: Use of "undef" without parentheses is ambiguous at (eval 4) line 3.
View gist:147953
Hugs> Nothing
Nothing
Hugs> Nothing == Nothing
True
Hugs> Nothing > 10
ERROR - Cannot infer instance
*** Instance : Num (Maybe a)
*** Expression : Nothing > 10
Hugs> Nothing < 10
View gist:147894
irb(main):001:0> nil
=> nil
irb(main):002:0> nil > 10
NoMethodError: undefined method `>' for nil:NilClass
from (irb):2
from :0
irb(main):003:0> 10 > nil
ArgumentError: comparison of Fixnum with nil failed
from (irb):3:in `>'
from (irb):3
View gist:147899
phpsh (c)2006 by Charlie Cheever and Dan Corson and Facebook, Inc.
type 'h' or 'help' to see instructions & features
New Feature: You can use the -c option to turn off coloring
php> echo(null > 10)
php> echo(null < 10)
1
php> echo(null == 10)
php> echo(null == null)
1
php>
View gist:147906
Lua 5.1.4 Copyright (C) 1994-2008 Lua.org, PUC-Rio
> print(nil)
nil
> print(nil > 10)
stdin:1: attempt to compare number with nil
stack traceback:
stdin:1: in main chunk
[C]: ?
> print(nil < 10)
stdin:1: attempt to compare nil with number
View gist:147914
Jython 2.2.1 on java1.6.0_0
Type "copyright", "credits" or "license" for more information.
>>> None
>>> None > 10
0
>>> None < 10
1
>>> None == None
1
>>>
View gist:147919
SQLite version 3.6.10
Enter ".help" for instructions
Enter SQL statements terminated with a ";"
sqlite> select null;
sqlite> select null>10, null<10, null=null, 10=10 as data;
|||1
sqlite>
View gist:147921
mysql> select null;
+------+
| NULL |
+------+
| NULL |
+------+
1 row in set (0.00 sec)
mysql> select null>10, null<10, null=null, 10=10 as data;
+---------+---------+-----------+------+
View gist:147923
scala> 10 == 10
res6: Boolean = true
scala> null > 10
<console>:5: error: value > is not a member of Null
null > 10
^
scala> null < 10
<console>:5: error: value < is not a member of Null
View gist:147909
//#Javascript
>>> null
null
>>> null == 10
false
>>> null > 10
false
>>> null < 10
true
>>> null == null