Commit Graph

170 Commits

Author SHA1 Message Date
Ted Kremenek
26320dc0ed Per API review, rename 'reserve' to 'reserveCapacity'.
Swift SVN r18272
2014-05-17 21:00:28 +00:00
Doug Gregor
bed81488c1 Revert r18232, r18220: we're not doing T* now.
Swift SVN r18250
2014-05-17 16:36:02 +00:00
Dave Abrahams
d6e4964ace [stdlib] Make _convertNSArrayToArray meet spec
I believe this correctly implements the "forced conversion" part of the
Arrays.rst document.

Swift SVN r18248
2014-05-17 14:08:33 +00:00
Dave Abrahams
2fc6414b5d [stdlib/Array] Improve another comment
Swift SVN r18245
2014-05-17 06:25:56 +00:00
Dave Abrahams
6b0c79a0f2 [stdlib/Array] Eliminate or label unused functions
Swift SVN r18244
2014-05-17 06:25:56 +00:00
Dave Abrahams
f57c2b8e47 [stdlib] Remove unused functions
Swift SVN r18240
2014-05-17 05:33:26 +00:00
Doug Gregor
73f02d1a69 Switch a bunch of UnsafePointer<T>'s over to T*
Swift SVN r18220
2014-05-16 22:32:01 +00:00
Arnold Schwaighofer
da6d9152b6 Differentiate between user assertion and preconditions and the like
assert() and fatalError()
These functions are meant to be used in user code. They are enabled in debug
mode and disabled in release or fast mode.

_precondition() and _preconditionFailure()
These functions are meant to be used in library code to check preconditions at
the api boundry. They are enabled in debug mode (with a verbose message) and
release mode (trap). In fast mode they are disabled.

_debugPrecondition() and _debugPreconditionFailure()
These functions are meant to be used in library code to check preconditions that
are not neccesarily comprehensive for safety (UnsafePointer can be null or an
invalid pointer but we can't check both). They are enabled only in debug mode.

_sanityCheck() and _fatalError()
These are meant to be used for internal consistency checks. They are only
enabled when the library is build with -DSWIFT_STDLIB_INTERNAL_CHECKS=ON.

I modified the code in the standard library to the best of my judgement.

rdar://16477198

Swift SVN r18212
2014-05-16 20:49:54 +00:00
Doug Gregor
b756fc29ec Don't require paretheses when mixing optional types and array types...
... unless we actually hit one of the confusing cases involving
multi-dimensional arrays (e.g., Int[]?[]), at which point one needs to
write parentheses <rdar://problem/16737035>.



Swift SVN r18181
2014-05-16 06:03:26 +00:00
Ted Kremenek
172cc3c984 Fix my last commit to accommodate for rename of NativeArray.
Swift SVN r18151
2014-05-16 00:45:48 +00:00
Ted Kremenek
5e966fdd52 Add basic '==' for Array, NativeArray, and Slice.
I suspect this can be made much better.  It only
works for comparing Array<T> and Array<T>,
NativeArray<T> and NativeArray<T>, etc., not
NativeArray<T> and Array<T>.  I also suspect
the implementation can be made better.  The goal
was to make this functional, as this basic
functionality was missing.

Implements <rdar://problem/16768095>.

Swift SVN r18150
2014-05-16 00:32:00 +00:00
Dave Abrahams
b666651e3f [stdlib] Rename NativeArray => ContiguousArray
Per API review feedback.

Swift SVN r18140
2014-05-15 23:24:09 +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
Dave Abrahams
8e1a85490b [stdlib] More infrastructure for Array bridging
Totally untested; tests are next.

Swift SVN r18096
2014-05-15 04:32:13 +00:00
Ted Kremenek
9eea282719 Switch range operators ".." and "...".
- 1..3 now means 1,2
- 1...3 now means 1,2,3

Implements <rdar://problem/16839891>

Swift SVN r18066
2014-05-14 07:36:00 +00:00
Dave Abrahams
0222047dda [stdlib] A couple of Array changes...
...that managed to sneak out of my last commit.

Swift SVN r18028
2014-05-13 22:03:57 +00:00
Dave Abrahams
34edde40ca [stdlib] Array bridging/bridge-cast entry points
Still needs lots of testing, but at least we have the code in and
building, finally.

Swift SVN r18027
2014-05-13 21:33:40 +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
Dave Abrahams
079821c8cc [stdlib] Start generating actual (new) Array types
Swift SVN r15769
2014-04-02 02:47:38 +00:00