Commit Graph

58 Commits

Author SHA1 Message Date
Ted Kremenek
178e2a32df Printing routines should append ".0" to floats, *not* taking locales into account.
Implements <rdar://problem/16895801>.

Swift SVN r18185
2014-05-16 07:27:54 +00:00
Dmitri Hrybenko
b966c9583f stdlib/{Array, Dictionary}: make debugDescription forward to debugDescription
of container elements

rdar://16929672


Swift SVN r18132
2014-05-15 22:08:07 +00:00
Dmitri Hrybenko
2a956966ac stdlib/runtime: teach DynamicCastToExistential1 to handle source values that
are existentials

rdar://16925792


Swift SVN r18107
2014-05-15 16:32:13 +00:00
Dmitri Hrybenko
011584a0b6 stdlib/pritning: untie string interpolation from string initializers
String interpolation invokes convertFromStringInterpolationSegment() function
now.  There is no need to add extensions to String to allow custom types to
participate in string interpolation.  Just implementing Printable will do the
right thing.


Swift SVN r18104
2014-05-15 09:56:02 +00:00
Dmitri Hrybenko
ed68ba833f stdlib/printing: add Streamable conformance to CString, and DebugPrintable
conformances to String and CString


Swift SVN r18003
2014-05-13 13:54:43 +00:00
Dmitri Hrybenko
2cc8fe40d4 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
2014-05-13 13:07:59 +00:00
Ted Kremenek
fad874708e Adjust test cases.
Swift SVN r17964
2014-05-12 22:01:52 +00:00
Joe Groff
3fded63cac stdlib: Proof-of-concept 'print' implementation for an arbitrary Array.
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
2014-02-14 05:15:33 +00:00