YAPC::EU 2018 Glasgow Update!
This commit is contained in:
parent
22f33d4004
commit
4e2d22a71d
1170 changed files with 15042 additions and 3047 deletions
12
Task/History-variables/Phix/history-variables-1.phix
Normal file
12
Task/History-variables/Phix/history-variables-1.phix
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
sequence history = {}
|
||||
|
||||
type hvt(object o)
|
||||
history = append(history,o)
|
||||
return true
|
||||
end type
|
||||
|
||||
hvt test = 1
|
||||
test = 2
|
||||
test = 3
|
||||
?{"current",test}
|
||||
?{"history",history}
|
||||
19
Task/History-variables/Phix/history-variables-2.phix
Normal file
19
Task/History-variables/Phix/history-variables-2.phix
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
-- history.e
|
||||
sequence histories = {}
|
||||
|
||||
global function new_history_id(object v)
|
||||
histories = append(histories,{v})
|
||||
return length(histories)
|
||||
end function
|
||||
|
||||
global procedure set_hv(integer hv, object v)
|
||||
histories[hv] = append(histories[hv],v)
|
||||
end procedure
|
||||
|
||||
global function get_hv(integer hv)
|
||||
return histories[hv][$]
|
||||
end function
|
||||
|
||||
global function get_hv_full_history(integer hv)
|
||||
return histories[hv]
|
||||
end function
|
||||
7
Task/History-variables/Phix/history-variables-3.phix
Normal file
7
Task/History-variables/Phix/history-variables-3.phix
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
include history.e
|
||||
|
||||
constant test2 = new_history_id(1)
|
||||
set_hv(test2, 2)
|
||||
set_hv(test2, 3)
|
||||
?{"current",get_hv(test2)}
|
||||
?{"history",get_hv_full_history(test2)}
|
||||
Loading…
Add table
Add a link
Reference in a new issue