First run at defer working - won't properly do every scope out of a loop yet, likely other problems

This commit is contained in:
Nathan Braswell
2016-01-25 13:48:27 -05:00
parent 135305fb76
commit 9973bc3bd3
2 changed files with 89 additions and 41 deletions

View File

@@ -47,13 +47,22 @@ obj stack<T> (Object, Serializable) {
fun clear() {
data.clear()
}
fun top(): T {
fun top(): ref T {
return data[data.size-1]
}
fun from_top(num: int): ref T {
return data[(data.size-1)-num]
}
fun size(): int {
return data.size
}
fun empty():bool {
return data.size == 0
}
fun for_each(func: fun(ref T):void) {
data.for_each(func)
}
fun for_each(func: fun(T):void) {
data.for_each(func)
}
}