forked from softdevteam/yksom
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This is roughly equivalent to the `is` operator in Python in that it checks normal objects for pointer equality, but numbers are checked for value equality. Note that SOM (or, at least, java-som) doesn't define/implement the latter cases properly yet (see SOM-st/SOM#23) so this commit makes us diverge slightly.
- Loading branch information
Showing
8 changed files
with
104 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
" | ||
VM: | ||
status: success | ||
stdout: | ||
true | ||
false | ||
false | ||
true | ||
true | ||
true | ||
false | ||
false | ||
true | ||
" | ||
|
||
obj1 = ( | ||
run = ( | ||
(1 == 1) println. | ||
(1 <> 1) println. | ||
(1 ~= 1) println. | ||
(1 <> 2) println. | ||
(1 ~= 2) println. | ||
|
||
(self == self) println. | ||
(self <> self) println. | ||
(self == 'a') println. | ||
(self <> 'a') println. | ||
) | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
" | ||
VM: | ||
status: success | ||
stdout: | ||
true | ||
true | ||
true | ||
true | ||
false | ||
false | ||
" | ||
|
||
obj2 = ( | ||
run = ( | ||
(1 == 1) println. | ||
(100 == 100) println. | ||
((1 << 200) == (1 << 200)) println. | ||
(1.0 == 1.0) println. | ||
(1.0 == 1) println. | ||
(1 == 1.0) println. | ||
) | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -48,6 +48,7 @@ pub enum Primitive { | |
New, | ||
PrintNewline, | ||
PrintString, | ||
RefEquals, | ||
Restart, | ||
Shl, | ||
Sub, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters