-
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.
Add
global:put:
primitive to the System
class.
`global:put:` should return value. Add errors for `global:put:`.
- Loading branch information
Showing
9 changed files
with
100 additions
and
60 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
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,36 @@ | ||
" | ||
VM: | ||
status: success | ||
stdout: | ||
true | ||
true | ||
42 | ||
42 | ||
String | ||
21 | ||
21 | ||
nil | ||
true | ||
false | ||
" | ||
|
||
system_global = ( | ||
run = ( | ||
((system global: #Integer) == Integer) println. | ||
system global: #Integer put: 42. | ||
((system global: #Integer) == Integer) println. | ||
Integer println. | ||
(system global: #Integer) println. | ||
system global: #Integer put: 'a'. | ||
Integer class println. | ||
system global: #ab put: 21. | ||
(system global: #ab) println. | ||
ab println. | ||
system global: #nil put: 'a'. | ||
system global: #true put: 'b'. | ||
system global: #false put: 'c'. | ||
nil println. | ||
true println. | ||
false 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,11 @@ | ||
" | ||
VM: | ||
status: error | ||
stderr: InvalidSymbol | ||
" | ||
|
||
system_global_invalid_symbol_err = ( | ||
run = ( | ||
system global: #ab. | ||
) | ||
) |
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,5 +1,6 @@ | ||
System = ( | ||
global: name = primitive | ||
printString: string = primitive | ||
printNewline = primitive | ||
global: name put: value = primitive | ||
printString: string = primitive | ||
printNewline = primitive | ||
) |
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 |
---|---|---|
|
@@ -38,6 +38,7 @@ pub enum Primitive { | |
DoubleDiv, | ||
Equals, | ||
Global, | ||
GlobalPut, | ||
GreaterThan, | ||
GreaterThanEquals, | ||
Halt, | ||
|
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