History variables: Difference between revisions
Content deleted Content added
m →version 1: removed the "style" from the PRE html tag. |
add swift |
||
Line 1,376: | Line 1,376: | ||
x history. |
x history. |
||
</lang> |
</lang> |
||
=={{header|Swift}}== |
|||
Swift does not support history variables. However, you can add a watcher that can track when the variable will change. |
|||
<lang Swift>var historyOfHistory = [Int]() |
|||
var history:Int = 0 { |
|||
willSet { |
|||
historyOfHistory.append(history) |
|||
} |
|||
} |
|||
history = 2 |
|||
history = 3 |
|||
history = 4 |
|||
println(historyOfHistory)</lang> |
|||
=={{header|Tcl}}== |
=={{header|Tcl}}== |