Example
kscript - <<"EOF"
println("getting started")
generateSequence() { readLine() }.map {
if (!it.startsWith(">")) it else
"huhu" + it
}.forEach { println(it) }
EOF
This won't work at the moment because stidin is used for both script and data.
Possible workaround: add -s option to provide script as parameter and skip stdin for script provision.
streamline further by using simple code wrapper for
kscript -st '"huhu" + it'