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
Array's getObjects:range: needs to fill the supplied buffer without
incrementing the reference count. For that reason, and to fulfill
lifetime expectations for Array elements that are computed
dynamically (e.g. from value types that are BridgedToObjectiveC), we
maintain a cache of converted objects associated with each Array.
Swift SVN r16105
Make CConstPointer<T> convertible from UnsafePointer<T>, inout T, and Array<T>, and nil; and make CMutablePointer<T> convertible from UnsafePointer<T>, inout T, inout Array<T>, and nil.
Swift SVN r15600
For container bridging, implement a '_bridge<T>' function that converts a Swift value to AnyObject using a runtime check for its _ObjCBridgeable conformance, crashing if one doesn't exist.
Swift SVN r14645
Think the scenarios through more carefully, create more reliable tests.
Fixes <rdar://problem/16105759> Too many retains for COW optimization
Swift SVN r14140
Define a "Mirror" protocol with methods for querying the number of children a structured value has, getting the name and mirror for each of those children, and a string and "IDE representation" of the value, as needed by playgrounds and by our planned generic printing facility.
In the runtime, define a "reflect" function that can provide a Mirror for any object, either using a "Reflectable" protocol conformance if available, or falling back to a magic implementation in the runtime that grovels the type metadata. Stub out a bare minimum default implementation.
Swift SVN r14139
Will serve as an IndexType for CollectionOfOne<T>
Open Question: should this become a full-fledged Int1 type, generated by
FixedPoint.gyb?
Swift SVN r13974
Mock up a naive Printable protocol, and do some dirty tricks in the runtime to implement a 'printAny' function that uses swift_conformsToProtocol to look up a conformance to Printable if the type has one, or falls back to a dumb opaque printing if it doesn't. Use this to make Array<T> Printable in some way or another for all T.
Swift SVN r13902
...which would of course prevent them from being used. Sadly, this includes
the one I just added, since I didn't actually test it against the original
project until now.
Add a regression test that all block shims have valid manglings without
any unmangled suffixes.
Swift SVN r12672