Files
SwiftShell/SwiftShellTests/Scripts/print_linenumbers.swift
T
Kare Morstol 4d2fca7b74 Add operator |>> for printing anything to a writable stream.
Replaced all uses of writeTo with the new operator in unit tests, test scripts and readme.
2014-12-04 20:05:15 +01:00

15 lines
233 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"} |>> standardoutput