-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
55: More comparisons r=vext01 a=ltratt This PR adds more comparisons to yksom: reference equality (1dca2bc) and various comparisons for doubles (82d35c5). Notice that the former commit means that we diverge slightly from SOM's current semantics (see SOM-st/SOM#23) although I think it's fair to say that @smarr thinks the approach we're taking in this PR is the right one (and if I've got that wrong, hopefully he'll shout!). Co-authored-by: Laurence Tratt <[email protected]>
- Loading branch information
Showing
14 changed files
with
194 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,46 @@ | ||
" | ||
VM: | ||
status: success | ||
stdout: | ||
false | ||
true | ||
true | ||
true | ||
false | ||
true | ||
false | ||
false | ||
false | ||
true | ||
true | ||
false | ||
true | ||
true | ||
true | ||
false | ||
" | ||
|
||
double10 = ( | ||
run = ( | ||
(1.0 = 0) println. | ||
(1.0 = 1) println. | ||
(1.0 ~= 0) println. | ||
(1.0 ~= 1) println. | ||
|
||
(1.0 < 1) println. | ||
(1.0 < 2) println. | ||
(2.0 < 0) println. | ||
|
||
(1.0 > 1) println. | ||
(1.0 > 2) println. | ||
(2.0 > 0) println. | ||
|
||
(1.0 >= 1) println. | ||
(1.0 >= 2) println. | ||
(2.0 >= 0) println. | ||
|
||
(1.0 <= 1) println. | ||
(1.0 <= 2) println. | ||
(2.0 <= 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,8 @@ | ||
False = Boolean ( | ||
asString = ( ^'false' ) | ||
not = ( ^true ) | ||
or: block = ( ^block value ) | ||
and: block = ( ^false ) | ||
ifTrue: block = ( ^nil ) | ||
ifFalse: block = ( ^block value ) | ||
) |
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 |
---|---|---|
@@ -1,6 +1,8 @@ | ||
True = Boolean ( | ||
asString = ( ^'true' ) | ||
not = ( ^false ) | ||
or: block = ( ^true ) | ||
and: block = ( ^block value ) | ||
ifTrue: block = ( ^block value ) | ||
ifFalse: block = ( ^nil ) | ||
) |
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 |
---|---|---|
|
@@ -49,6 +49,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
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