Mercurial > hg > truffle
annotate graal/com.oracle.truffle.sl.test/tests/Null.sl @ 18279:46e10fe1ade1
made Replacements interface extend Remote
author | Doug Simon <doug.simon@oracle.com> |
---|---|
date | Thu, 06 Nov 2014 13:18:23 +0100 |
parents | b16ec83edc73 |
children |
rev | line source |
---|---|
13821
b16ec83edc73
Documentation and more refactoring of Simple Language
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
1 /* The easiest way to generate null: a function without a return statement implicitly returns null. */ |
b16ec83edc73
Documentation and more refactoring of Simple Language
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
2 function null() { |
b16ec83edc73
Documentation and more refactoring of Simple Language
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
3 } |
b16ec83edc73
Documentation and more refactoring of Simple Language
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
4 |
b16ec83edc73
Documentation and more refactoring of Simple Language
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
5 function main() { |
b16ec83edc73
Documentation and more refactoring of Simple Language
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
6 println(null()); |
b16ec83edc73
Documentation and more refactoring of Simple Language
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
7 println(null() == null()); |
b16ec83edc73
Documentation and more refactoring of Simple Language
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
8 println(null() != null()); |
b16ec83edc73
Documentation and more refactoring of Simple Language
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
9 println(null() == 42); |
b16ec83edc73
Documentation and more refactoring of Simple Language
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
10 println(null() != 42); |
b16ec83edc73
Documentation and more refactoring of Simple Language
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
11 println(null() == "42"); |
b16ec83edc73
Documentation and more refactoring of Simple Language
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
12 println(null() != "42"); |
b16ec83edc73
Documentation and more refactoring of Simple Language
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
13 } |