24 lines
456 B
Plaintext
24 lines
456 B
Plaintext
import io:*
|
|
import vector:*
|
|
|
|
obj container {
|
|
var v1: vector<int>
|
|
var v2: vector<int>
|
|
fun construct(): *container {
|
|
v1.construct()
|
|
v2.construct()
|
|
}
|
|
fun destruct() {
|
|
v1.destruct()
|
|
v2.destruct()
|
|
}
|
|
}
|
|
|
|
fun main():int {
|
|
var c.construct() : container
|
|
c.v1 = vector(1); // need this ; otherwise this could ambigiously be one or two lines
|
|
(c.v1).for_each(fun(i: int) {
|
|
println(i)
|
|
})
|
|
}
|