June 2018 Update

This commit is contained in:
Ingy döt Net 2018-06-22 20:57:24 +00:00
parent ba8067c3b7
commit 22f33d4004
5278 changed files with 84726 additions and 14379 deletions

View file

@ -0,0 +1,51 @@
import extensions.
import system'collections.
import system'routines.
import extensions'routines.
class HistoryVariable
{
object prop Value :: _value.
stack _previous := Stack new.
set Value:v
[
if ($nil != _value)
[
_previous push(_value)
].
_value := v
]
undo
[
ifnot (_previous isEmpty)
[
_value := _previous pop
];
[
_value := $nil
]
]
enumerator => _previous.
dispatch => _value.
}
program =
[
var o := HistoryVariable new.
o Value := 5.
o Value := "foo".
o Value := o Value + "bar".
console printLine(o).
o forEach:printingLn.
o undo; undo; undo.
console printLine(o Value).
].