-
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 a hashmap which maps symbols to their corresponding object and retrieve an object from this hashmap when its symbol is referenced during runtime.
- Loading branch information
Showing
7 changed files
with
125 additions
and
15 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 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,4 +1,6 @@ | ||
System = ( | ||
printString: string = primitive | ||
printNewline = primitive | ||
global: name = 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
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