initial spike at implementing the standard collection functions on iterators; though compiler error prevented me from implementing all the lazy functions just yet
This commit is contained in:
@@ -48,15 +48,24 @@ fun main(args: Array<String>) {
|
||||
}
|
||||
val outDir = File(srcDir, "generated")
|
||||
|
||||
|
||||
// JavaIterables - Generic iterable stuff
|
||||
generateFile(File(outDir, "ArraysFromJavaIterables.kt"), "package kotlin\n\nimport kotlin.util.*", File(srcDir, "JavaIterables.kt")) {
|
||||
it.replaceAll("java.lang.Iterable<T", "Array<T").replaceAll("java.lang.Iterable<T", "Array<T")
|
||||
}
|
||||
generateFile(File(outDir, "ArraysFromJavaIterablesLazy.kt"), "package kotlin\n\nimport kotlin.util.*", File(srcDir, "JavaIterablesLazy.kt")) {
|
||||
it.replaceAll("java.lang.Iterable<T", "Array<T").replaceAll("java.lang.Iterable<T", "Array<T")
|
||||
}
|
||||
|
||||
generateFile(File(outDir, "StandardFromJavaIterables.kt"), "package kotlin\n\nimport kotlin.util.*", File(srcDir, "JavaIterables.kt")) {
|
||||
it.replaceAll("java.lang.Iterable<T", "Iterable<T")
|
||||
}
|
||||
generateFile(File(outDir, "StandardFromJavaIterablesLazy.kt"), "package kotlin\n\nimport kotlin.util.*", File(srcDir, "JavaIterablesLazy.kt")) {
|
||||
it.replaceAll("java.lang.Iterable<T", "Iterable<T")
|
||||
}
|
||||
|
||||
generateFile(File(outDir, "JavaUtilIteratorsFromJavaIterables.kt"), "package kotlin.util", File(srcDir, "JavaIterables.kt")) {
|
||||
it.replaceAll("java.lang.Iterable<T", "java.util.Iterator<T")
|
||||
}
|
||||
|
||||
|
||||
// JavaCollections - methods returning a collection of the same input size (if its a collection)
|
||||
|
||||
Reference in New Issue
Block a user