shortening of str and vec
This commit is contained in:
103
stdlib/vec_literals.krak
Normal file
103
stdlib/vec_literals.krak
Normal file
@@ -0,0 +1,103 @@
|
||||
import vec
|
||||
|
||||
fun vec<T>(first:T, second:T):vec::vec<T> {
|
||||
var out.construct():vec::vec<T>
|
||||
out.add(first)
|
||||
out.add(second)
|
||||
return out
|
||||
}
|
||||
|
||||
fun vec<T>(first:T, second:T, third:T):vec::vec<T> {
|
||||
var out.construct():vec::vec<T>
|
||||
out.add(first)
|
||||
out.add(second)
|
||||
out.add(third)
|
||||
return out
|
||||
}
|
||||
|
||||
fun vec<T>(first:T, second:T, third:T, fourth:T):vec::vec<T> {
|
||||
var out.construct():vec::vec<T>
|
||||
out.add(first)
|
||||
out.add(second)
|
||||
out.add(third)
|
||||
out.add(fourth)
|
||||
return out
|
||||
}
|
||||
|
||||
fun vec<T>(first:T, second:T, third:T, fourth:T, fifth:T):vec::vec<T> {
|
||||
var out.construct():vec::vec<T>
|
||||
out.add(first)
|
||||
out.add(second)
|
||||
out.add(third)
|
||||
out.add(fourth)
|
||||
out.add(fifth)
|
||||
return out
|
||||
}
|
||||
|
||||
fun vec<T>(first:T, second:T, third:T, fourth:T, fifth:T, sixth:T):vec::vec<T> {
|
||||
var out.construct():vec::vec<T>
|
||||
out.add(first)
|
||||
out.add(second)
|
||||
out.add(third)
|
||||
out.add(fourth)
|
||||
out.add(fifth)
|
||||
out.add(sixth)
|
||||
return out
|
||||
}
|
||||
|
||||
fun vec<T>(first:T, second:T, third:T, fourth:T, fifth:T, sixth:T, seventh:T):vec::vec<T> {
|
||||
var out.construct():vec::vec<T>
|
||||
out.add(first)
|
||||
out.add(second)
|
||||
out.add(third)
|
||||
out.add(fourth)
|
||||
out.add(fifth)
|
||||
out.add(sixth)
|
||||
out.add(seventh)
|
||||
return out
|
||||
}
|
||||
|
||||
fun vec<T>(first:T, second:T, third:T, fourth:T, fifth:T, sixth:T, seventh:T, eighth:T):vec::vec<T> {
|
||||
var out.construct():vec::vec<T>
|
||||
out.add(first)
|
||||
out.add(second)
|
||||
out.add(third)
|
||||
out.add(fourth)
|
||||
out.add(fifth)
|
||||
out.add(sixth)
|
||||
out.add(seventh)
|
||||
out.add(eighth)
|
||||
return out
|
||||
}
|
||||
|
||||
fun vec<T>(first:T, second:T, third:T, fourth:T, fifth:T, sixth:T, seventh:T, eighth:T, ninth:T):vec::vec<T> {
|
||||
var out.construct():vec::vec<T>
|
||||
out.add(first)
|
||||
out.add(second)
|
||||
out.add(third)
|
||||
out.add(fourth)
|
||||
out.add(fifth)
|
||||
out.add(sixth)
|
||||
out.add(seventh)
|
||||
out.add(eighth)
|
||||
out.add(ninth)
|
||||
return out
|
||||
}
|
||||
|
||||
fun vec<T>(first:T, second:T, third:T, fourth:T, fifth:T, sixth:T, seventh:T, eighth:T, ninth:T, tenth:T, eleventh:T, twelveth:T):vec::vec<T> {
|
||||
var out.construct():vec::vec<T>
|
||||
out.add(first)
|
||||
out.add(second)
|
||||
out.add(third)
|
||||
out.add(fourth)
|
||||
out.add(fifth)
|
||||
out.add(sixth)
|
||||
out.add(seventh)
|
||||
out.add(eighth)
|
||||
out.add(ninth)
|
||||
out.add(tenth)
|
||||
out.add(eleventh)
|
||||
out.add(twelveth)
|
||||
return out
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user