Data update
This commit is contained in:
parent
5150844a7d
commit
4bb20c9b71
7735 changed files with 38060 additions and 199180 deletions
|
|
@ -1,45 +1,42 @@
|
|||
define :history [][
|
||||
init: [
|
||||
define :history [
|
||||
init: method [][
|
||||
this\record: @[0]
|
||||
]
|
||||
]
|
||||
assign: function [historyVar,newValue][
|
||||
historyVar\record: historyVar\record ++ newValue
|
||||
assign: method [newValue][
|
||||
this\record: this\record ++ newValue
|
||||
]
|
||||
|
||||
records: method [][
|
||||
this\record
|
||||
]
|
||||
|
||||
retrieve: method [][
|
||||
result: last this\record
|
||||
this\record: chop this\record
|
||||
return result
|
||||
]
|
||||
|
||||
current: method [][
|
||||
return last this\record
|
||||
]
|
||||
]
|
||||
|
||||
alias.infix {'-->} 'assign
|
||||
|
||||
records: function [historyVar][
|
||||
historyVar\record
|
||||
]
|
||||
|
||||
retrieve: function [historyVar][
|
||||
result: last historyVar\record
|
||||
historyVar\record: chop historyVar\record
|
||||
return result
|
||||
]
|
||||
|
||||
current: function [historyVar][
|
||||
return last historyVar\record
|
||||
]
|
||||
|
||||
do [
|
||||
h: to :history []
|
||||
h: to :history []
|
||||
|
||||
do ::
|
||||
print "Assigning three values: 1, 2, 3..."
|
||||
h --> 1
|
||||
h --> 2
|
||||
h --> 3
|
||||
h\assign 1
|
||||
h\assign 2
|
||||
h\assign 3
|
||||
|
||||
print "\nHistory (oldest values first):"
|
||||
print [">" records h]
|
||||
print [">" h\records]
|
||||
|
||||
print ["\nCurrent value is:" current h]
|
||||
print ["\nCurrent value is:" h\current]
|
||||
|
||||
print "\nRecalling the three values..."
|
||||
loop 1..3 'x ->
|
||||
print ["- Recalled:" retrieve h]
|
||||
print ["- Recalled:" h\retrieve]
|
||||
|
||||
print "\nHistory:"
|
||||
print [">" records h]
|
||||
]
|
||||
print [">" h\records]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue