Files
SwiftShell/SwiftShellTests/Scripts/print_linenumbers.swift
T
Kare Morstol 977888c03b Rename "write" functions to "writeTo".
Because it makes more sense.
2014-10-25 19:17:07 +02:00

15 lines
241 B
Swift
Executable File

#!/usr/bin/env swiftshell
import SwiftShell
/*
var i = 1
for line in standardinput.lines() {
print("line \(i++): ")
println(line)
}
*/
var i = 1
standardinput.lines() |> map {line in "line \(i++): \(line)\n"} |> writeTo(standardoutput)