-
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
716a2ed
commit 9aefa84
Showing
1 changed file
with
4 additions
and
33 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 |
---|---|---|
@@ -1,43 +1,14 @@ | ||
(| | ||
init_true = (| true_mirror | | ||
true_mirror: primitives mirrorOn: true. | ||
|
||
true_mirror toSlot: 'ifTrue:' Add: (| :blck | blck value). | ||
true_mirror toSlot: 'ifFalse:' Add: (| :blck | nil.). | ||
). | ||
init_false = (| false_mirror | | ||
false_mirror: primitives mirrorOn: false. | ||
|
||
false_mirror toSlot: 'ifTrue:' Add: (| :blck | nil). | ||
false_mirror toSlot: 'ifFalse:' Add: (| :blck | blck value.). | ||
). | ||
|
||
init = (| block_traits_mirror. | | ||
init_true. | ||
init_false. | ||
|
||
block_traits_mirror: primitives mirrorOn: block_traits. | ||
block_traits_mirror toSlot: 'whileTrue:' Add: (| :blck | | ||
self value ifFalse: [ ^nil ]. | ||
blck value. | ||
^self whileTrue: blck. | ||
). | ||
). | ||
|
||
test_while = (| i <- 0. | | ||
[ i < 500 ] whileTrue: [ | ||
'i: ' print. | ||
i asString print. | ||
'\n' print. | ||
# 'number of frames: ' print. | ||
# primitives interpreter numberOfFrames asString print. | ||
# '\n\n' print. | ||
'number of frames: ' print. | ||
primitives interpreter numberOfFrames asString print. | ||
'\n\n' print. | ||
|
||
i: i + 1. | ||
]. | ||
). | ||
test = (|| | ||
init. | ||
test_while. | ||
). | ||
|) test. | ||
|) test_while. |