Some bugfixes and added templated member functions\! (even for templated objs\!) In this vein, added in_place and map functions to vector\!

This commit is contained in:
Nathan Braswell
2015-05-27 00:58:33 -04:00
parent 88bab7f0d7
commit 85834789e4
9 changed files with 120 additions and 32 deletions

View File

@@ -0,0 +1,30 @@
import io:*
obj templd<T> {
var data: T
fun construct(dataIn:T):void {
data = dataIn
}
fun conv<U>(func: fun(T):U): U {
return func(data)
}
}
obj onlyMember {
var data: int
fun printAThing<T>(otherDat: T):void {
println(data)
println(otherDat)
}
}
fun main():int {
var hmm.construct(3): templd<int>
println(hmm.conv(fun(it:int):double { return it + 0.141592; }))
var onlyM: onlyMember
onlyM.data = 7
onlyM.printAThing("hi")
return 0
}