Experimenting with fungll optimization, implement the okmij.org poly-variadic fix-point combinator for mutual recursion
This commit is contained in:
@@ -96,7 +96,7 @@ obj map<T,U> (Object, Serializable) {
|
||||
fun remove(key: ref T) {
|
||||
var idx = keys.find(key)
|
||||
if (idx < 0)
|
||||
util::error("trying to remove nonexistant key-value!")
|
||||
return;
|
||||
keys.remove(idx)
|
||||
values.remove(idx)
|
||||
}
|
||||
@@ -123,5 +123,8 @@ obj map<T,U> (Object, Serializable) {
|
||||
}
|
||||
return to_ret
|
||||
}
|
||||
fun pop(): util::pair<T,U> {
|
||||
return util::make_pair(keys.pop(), values.pop())
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user