Commit Graph

73 Commits

Author SHA1 Message Date
Patrick Pijnappel
77b4d73560 [stdlib] Replace stray usages of generator by iterator 2016-03-17 06:07:20 +11:00
Daniel Duan
276370b599 [stdlib] apply SE-0040 to stdlib 2016-03-11 16:01:41 -08:00
Dmitri Gribenko
f0633ce5a9 stdlib: Sequence.iterator() => .makeIterator() 2016-02-23 13:52:30 -08:00
Dmitri Gribenko
dd75aed67a Merge remote-tracking branch 'origin/master' into swift-3-api-guidelines 2016-02-17 14:40:05 -08:00
Nate Cook
f3c4e0ac74 Remove style on *generator* and friends. 2016-02-12 04:20:01 -06:00
Dmitri Gribenko
c5d694c4af Swift 3 migration: add migration aids for EnumeratedIterator and EnumeratedSequence 2016-01-21 15:25:21 -08:00
Dmitri Gribenko
a34a44f6c2 Swift 3 migration: add migration aids for EnumerateSequence 2016-01-21 11:48:41 -08:00
Max Moiseev
86680ec622 [stdlib] @available attributes for removed APIs 2016-01-20 13:08:27 -08:00
Max Moiseev
f51e708a8f Merge remote-tracking branch 'origin/master' into swift-3-api-guidelines 2016-01-04 12:25:25 -08:00
Zach Panzarino
e3a4147ac9 Update copyright date 2015-12-31 23:28:40 +00:00
Max Moiseev
a7339e67ac Merge remote-tracking branch 'origin' into swift-3-api-guidelines 2015-12-22 11:36:07 -08:00
Chris Lattner
66f7ef1295 Move stdlib off ++ and -- 2015-12-21 18:07:36 -08:00
Dmitri Gribenko
06577273e9 var Sequence.enumerated => func 2015-12-18 16:22:24 -08:00
Doug Gregor
a97ab6dd14 Merge remote-tracking branch 'origin/master' into swift-3-api-guidelines 2015-12-18 10:15:47 -08:00
Patrick Pijnappel
a61839d696 [stdlib] Add ordering guarantee to min() and max() docs 2015-12-18 09:51:34 +11:00
Max Moiseev
3fe0c60d7f Merge remote-tracking branch 'origin/master' into swift-3-api-guidelines 2015-12-17 11:00:02 -08:00
Patrick Pijnappel
fe478b7633 [stdlib] Add sort stability comment to min()/max() 2015-12-17 14:17:50 +11:00
Patrick Pijnappel
75a6609c61 [stdlib] Unabbreviate local variable names 2015-12-17 14:07:58 +11:00
Patrick Pijnappel
370f4f0de4 [stdlib] Refactor min(_:_:_:_:) 2015-12-17 14:00:03 +11:00
Patrick Pijnappel
220f2d1c89 [stdlib] Refactor min(_:_:) 2015-12-17 13:59:48 +11:00
Arsen Gasparyan
9f728c6dbd [stdlib] Make comparison operator choices consistent 2015-12-16 22:50:36 +03:00
Arsen Gasparyan
ee97757756 Set default value 2015-12-15 23:30:08 +03:00
Max Moiseev
806be29941 Merge remote-tracking branch 'origin' into swift-3-api-guidelines 2015-12-14 12:05:35 -08:00
Patrick Pijnappel
95622c435b [stdlib] Replace .Some(x) and .None by x and nil, respectively 2015-12-13 12:10:43 +11:00
Maxim Moiseev
844b81c46b SequenceType => Sequence 2015-12-09 17:16:56 -08:00
Dmitri Gribenko
d72b5ab575 func SequenceType.enumerate() => var SequenceType.enumerated 2015-12-09 17:13:21 -08:00
Dmitri Gribenko
1c0047829a Rename SequenceType.generate() to SequenceType.iterator() 2015-12-09 17:11:17 -08:00
Dmitri Gribenko
2cf172160c Rename SequenceType.Generator associated type to SequenceType.Iterator 2015-12-09 17:11:05 -08:00
Dmitri Gribenko
31598d41bf Rename GeneratorType to IteratorProtocol 2015-12-07 17:08:32 -08:00
Dmitri Gribenko
3505975a75 Make EnumerateGenerator and EnumerateSequence initializers internal 2015-12-07 16:56:31 -08:00
Dmitri Gribenko
866ce291c3 Fix coding style 2015-12-07 16:56:18 -08:00
Dmitri Gribenko
f230ebeda9 Change EnumerateGenerator.Element's label from 'index' to 'offset' 2015-12-07 16:54:38 -08:00
Max Moiseev
d0e1cb3a0e Merge remote-tracking branch 'origin/master' into swift-3-api-guidelines 2015-12-07 16:43:20 -08:00
codestergit
6e85e69283 [stdlib] Using map and guard let for nil handling 2015-12-06 04:01:33 +05:30
Johan K. Jensen
fa76656c82 Remove instances of duplicated words 2015-12-03 20:00:29 +01:00
Dmitri Gribenko
174d475833 stdlib: Remove unavavailable APIs that were left as migration aids
These APIs are from the Swift 1.2 => Swift 2.0 transition, and are not
relevant anymore.

Removing them reduces the surface area of the library that needs to be
reviewed.
2015-12-02 01:19:50 -08:00
Dmitri Hrybenko
dd3194a18c stdlib: adopt @warn_unused_result
rdar://20957486

Swift SVN r31048
2015-08-06 14:53:18 +00:00
Dave Abrahams
f59279dc31 [stdlib] Fix a couple of availability message
Swift SVN r31025
2015-08-05 20:02:34 +00:00
David Farler
0d1b03086d Add slicing extensions to SequenceType and CollectionType.
rdar://problem/21663830

Add the following new requirements to SequenceType with default implementations:

- dropFirst(n)
- dropLast(n)
- prefix(n)
- suffix(n)
- split(n)

In addition, provide specialized default implementations of these for CollectionTypes with forward, bidirectional, and random-access Index types where possible.

Add the following new requirements to CollectionType with default implementations:

- prefixThrough(n)
- prefixUpTo(n)
- suffixFrom(n)
- split() // isSeparator closure

Add the following convenience APIs:

- dropFirst() -> calls dropFirst(1)
- dropLast() -> calls dropLast(1)

Add a tentative underscored API:

- split() // takes Equatable separator.

Some APIs have undefined behavior when creating slices where the endpoints go beyond the bounds of the underlying collection. This will be fixed later by trapping creation of slices with invalid indices (rdar://problem/21822657).

Swift SVN r30371
2015-07-18 06:51:22 +00:00
Dave Abrahams
913f09838a [stdlib] Add a default generate() for generators...
...that are also sequences, and rip out all redundant implementations of
generate() that match a default.

Swift SVN r30035
2015-07-09 19:49:24 +00:00
Dmitri Hrybenko
80b1380fe8 stdlib: fold Sliceable into CollectionType and de-underscore SubSequence
Swift SVN r29845
2015-07-01 18:31:25 +00:00
Dmitri Hrybenko
fdd73a57b4 stdlib: add tests for generic parameter names on EnumerateGenerator,
EnumerateSequence

Part of rdar://21429126

Swift SVN r29629
2015-06-24 20:41:58 +00:00
Dmitri Hrybenko
55bb9a806b stdlib: replace implementations of unavailable functions with fatalError()
Reduces the stdandard library dylib size by 10 Kb for each slice.

Swift SVN r28884
2015-05-21 20:22:13 +00:00
Dmitri Hrybenko
53f3ccf850 stdlib: change CollectionType.count() into a property
Swift SVN r28829
2015-05-20 09:14:43 +00:00
Dmitri Hrybenko
6aa84e164d stdlib: clean up some FIXMEs for protocol extensions
Swift SVN r28661
2015-05-16 04:26:21 +00:00
Dmitri Hrybenko
313701286b stdlib: Various punctuation and markup improvements to the comments.
Patch by Brian Lanier.

Swift SVN r28659
2015-05-16 03:04:51 +00:00
Ted Kremenek
62feb5c949 Change @availability to @available.
This came out of today's language review meeting.
The intent is to match #available with the attribute
that describes availability.

This is a divergence from Objective-C.

Swift SVN r28484
2015-05-12 20:06:13 +00:00
Dmitri Hrybenko
68ef59e37a stdlib: Convert comments to use '- requires:' instead of 'Requires:'.
Tidy misc. comments and markdown along the way.

Patch by Brian Lanier.

Swift SVN r28473
2015-05-12 17:47:11 +00:00
Dave Abrahams
5c55682d8b [stdlib] Capitalize keywords in doc comments
Again, the text is a lot more readable that way.

Swift SVN r28472
2015-05-12 16:59:13 +00:00
Dave Abrahams
106b39a497 [stdlib] Indent bullet continuations in doc comments
The text is a lot more readable that way.

Swift SVN r28471
2015-05-12 16:59:08 +00:00