mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
stdlib/printing: replace four printing systems with one new one
The old ones were: - print/println - printAny - printf - Console The new printing story is just print/println. Every object can be printed. You can customize the way it is printed by adopting Printable protocol. Full details in comments inside stdlib/core/OutputStream.swift. Printing is not completely finished yet. We still have ReplPrintable, which should be removed, string interpolation still uses String constructors, and printing objects that don't conform to Printable will result in printing mangled names. Swift SVN r18001
This commit is contained in:
@@ -11,7 +11,7 @@ func testFindFileAndURL(path: String) {
|
||||
var content = String.stringWithContentsOfFile(
|
||||
path, usedEncoding: &usedEncoding, error: &err)
|
||||
|
||||
println("error: " + (err ? err!.description : "<no error>"))
|
||||
println("error: " + (err ? err.description : "<no error>"))
|
||||
println("content: " + (content ? content!.lines[0] : "<no content>"))
|
||||
|
||||
var url = NSURL.URLWithString("file://" + path)
|
||||
@@ -20,7 +20,7 @@ func testFindFileAndURL(path: String) {
|
||||
content = String.stringWithContentsOfURL(
|
||||
url, usedEncoding: &usedEncoding, error: &err)
|
||||
|
||||
println("error: " + (err ? err!.description : "<no error>"))
|
||||
println("error: " + (err ? err.description : "<no error>"))
|
||||
println("content: " + (content ? content!.lines[0] : "<no content>"))
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user