Skip to content

Commit 47e06ae

Browse files
committed
added incubator package for devel
1 parent 1149c82 commit 47e06ae

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
package kscript.experimental
2+
3+
import java.io.File
4+
5+
/**
6+
* Experimental support methods. Those may change without further notice.
7+
*
8+
* @author Holger Brandl
9+
*/
10+
11+
12+
fun <T> File.mapLines(trafo: (String) -> T) {
13+
return useLines {
14+
it.map { trafo(it) }
15+
}
16+
}
17+
18+
fun String.processLines(trafo: (String) -> String) {
19+
split("\n").map { println(trafo(it)) }
20+
}

0 commit comments

Comments
 (0)