Commit Graph

121 Commits

Author SHA1 Message Date
practicalswift
cc852042c9 [gardening] Fix accidental trailing whitespace. 2016-10-29 10:22:58 +02:00
Dave Abrahams
5c13e35f29 [stdlib] Suppress noisy warnings
We don't have a way yet to say "this is deprecated for users, but let
the stdlib use it without complaining" so we need to do refactoring
shenanigans.
2016-08-28 15:06:42 -07:00
Rintaro Ishizaki
2a9b78e193 stdlib: Add unavailable declarations for APIs renamed in SE-0118
Sequence.sort(_:) => sorted(by:)
Sequence.sort() => sorted()
Sequence.elementsEqual(_:isEquivalent) => elementsEqual(_:by:)
Sequence.contains(_:) => contains(where:)
Sequence reduce(_:combine:) => reduce(_:_:)
UnicodeCodec.encode(_:output:) => encode(_:into:)
ManagedBuffer.create(_:initialValue:)
  => create(minimumCapacity:makingHeaderWith:)
ManagedBufferPointer.init(bufferClass:minimumCapacity:initialValue)
  => init(bufferClass:minimumCapacity:makingHeaderWith:)
2016-08-14 03:28:01 +09:00
Nate Cook
559092bbf2 [stdlib] Revise stdlib documentation comments
- Expand pre-example explanations
- Update documentation for SE-0118
- Removing remaining 'iff' usage
- Revise Array discussion
- Fix formIndex(_:offsetBy) parameter formatting
- Improve index/formIndex(_:offsetBy:(limitedBy:)?) discussion
- Update Quick Look discussions
- Fixes grammar inconsistencies
- Adds parameter / return documentation
- Adds and expands on examples
- Revises AnyObject discussion for new `id` bridging rules
- Revise readLine, print, and assertion functions
- Add missing docs to String index-moving methods
2016-08-05 16:07:46 -05:00
Michael Ilseman
b7c9eddd11 [noescape by default] drop @noescape from stdlib 2016-08-04 16:09:01 -07:00
Nate Cook
13d1ac5b81 [stdlib] Update partition implementation with feedback 2016-07-21 10:18:20 -05:00
Nate Cook
d7ee56088f [stdlib] Implement partition API change (SE-0120) 2016-07-21 10:16:54 -05:00
Dave Abrahams
014b6972cf isOrderedBefore: => by areInIncreasingOrder: 2016-07-19 07:05:54 -06:00
Michael Gottesman
fc37603c5f Revert "Implement SE-0118" 2016-07-18 16:44:58 -07:00
Dave Abrahams
f3ccc956c6 isOrderedBefore: => by areInIncreasingOrder: 2016-07-18 14:29:09 -06:00
Michael Gottesman
40e1991e12 Revert "Name and label changes for closure parameters (for review only) (#2981)"
This reverts commit 18406900ba.
2016-07-15 19:45:26 -07:00
Dave Abrahams
18406900ba Name and label changes for closure parameters (for review only) (#2981)
Implement SE-0118 Name and label changes for closure parameters

[SE-0118](https://github.com/apple/swift-evolution/blob/master/proposals/0118-closure-parameter-names-and-labels.md)
2016-07-15 15:31:48 -07:00
Rintaro Ishizaki
6ef62f3c73 [stdlib] Better diagnosis for unavailable APIs
Added tests for expected-error and fix-its.

- Add arguments signature regardless that is the same as before.
  Because the error message looks more natural.
  e.g. "makeIterator" => "makeIterator()",
  "replaceSubrange" => "replaceSubrange(_:with:)"
- Any${ExistentialCollection}.underestimateCount() was a method, not
  computed property.
- 'LazySequenceType' has been renamed to 'LazySequenceProtocol', but not
  'LazyCollectionProtocol'
- Streamable.writeTo(_:) had no argument label.
- Fixed typo in print() debugPrint() error message (not working for now)
- Repeated.init(): changed `renamed` to `message` because the arugment
  order has changed.
- Marked `public` for some unavailable method on `Sequence`
- Sequence.split(_:maxSplit:allowEmptySlices) was replaced with
  split(separator:maxSplits:omittingEmptySubsequences:),
  not split(separator:omittingEmptySubsequences:isSeparator:)
- Sequence.split(_:allowEmptySlices:isSeparator) was replaced with
  split(maxSplits:omittingEmptySubsequences:isSeparator:),
  not split(_:omittingEmptySubsequences:isSeparator:)
- Sequence.startsWith(_:isEquivalent:) or startsWith(_:) had no label on
  the first argument.
- transcode(_:_:_:_:stopOnError), not transcode(_:_:_:_:stoppingOnError)
- Removed mutating methods from UnsafePointer.
  alloc(_:), dealloc(_:), setter:memory, initialize(_:), destroy(),
  and destroy(_:)
2016-07-01 14:52:09 +09:00
Trent Nadeau
b9db36cda5 Removed last uses of @warn_unused_result 2016-06-06 19:12:51 -04:00
Dmitri Gribenko
d591f9cf7a stdlib: remove most uses of @warn_unused_result, which does nothing now
I kept the one on sorted(), because that one requires a less trivial
change.
2016-05-19 18:39:39 -07:00
Mark Lacey
e03d334b68 Use Builtin.unreachable() in unavailable functions.
Saves a bit of code size in the standard library by eliminating some
static strings and function calls.

rdar://problem/25767016
2016-05-02 21:30:25 -07:00
practicalswift
d804026b34 [gardening] Fix "a" vs. "an" issues. 2016-05-01 13:29:57 +02:00
Dave Abrahams
9bee5d182f [stdlib] location/formLocation => index/formIndex 2016-04-26 17:46:16 -07:00
Nate Cook
6e274913bf [stdlib] Revise documentation for Array- and Set-related types.
This adds and expands documentation for sequences, collections, and the array
types as well as `Set` and its related protocols.
2016-04-25 12:54:39 -05:00
Dmitri Gribenko
8e886a3bdd stdlib: ranges: remove range protocols
The RangeProtocol was a very weak and fragile abstraction because it
didn't specify the interpretation of the endpoints.  To write a
non-trivial algorithm, one usually needed to consult that information.
The standard library code only actually worked correctly with half-open
and closed ranges (and didn't handle fully open ranges, for example).

The other two protocols, HalfOpenRangeProtocol and ClosedRangeProtocol,
were only used for code sharing, and present an ABI burden.  We can use
gyb instead.
2016-04-22 18:15:06 -07:00
Dave Abrahams
47a870cc50 [stdlib] Use location/formLocation for all index movement 2016-04-21 17:13:41 -07:00
Dmitri Gribenko
fc8d62dfbb Merge remote-tracking branch 'origin/master' into swift-3-indexing-model 2016-04-18 14:40:06 -07:00
practicalswift
db452dcbe9 [gardening] "[ a, b ]" → "[a, b]" 2016-04-17 21:26:08 +02:00
Dmitri Gribenko
2b35fea059 Merge remote-tracking branch 'origin/master' into swift-3-indexing-model 2016-04-16 00:30:12 -07:00
Chris Lattner
4fd8418ba7 move the stdlib to put noescape and autoclosure on the type, instead of
the parameter.  Progress towards SE-0049.
2016-04-14 23:13:43 -07:00
Dmitri Gribenko
cfea1a3f58 Merge remote-tracking branch 'origin/master' into swift-3-indexing-model 2016-04-14 17:00:46 -07:00
Dmitri Gribenko
10697f939f Merge commit '510f29abf77e202780c11d5f6c7449313c819030' into swift-3-indexing-model 2016-04-14 13:45:27 -07:00
swift-ci
0ac59a50f8 Merge pull request #1807 from Togira/master 2016-04-12 21:30:10 -07:00
Dmitri Gribenko
d52cbab5c2 Merge commit '0ff3239b962218267d37307e53906b31315a1cfc' into swift-3-indexing-model
This commit is the parent of the commit that implemented SE-0046
Establish consistent label behavior across all parameters including
first labels
2016-04-09 16:18:33 -07:00
Manav Gabhawala
7928140f79 [SE-0046] Implements consistent function parameter labels by discarding extraneous parameter names and adding _ where necessary 2016-04-06 20:21:58 -04:00
Dave Abrahams
5864117b1b [stdlib] De-underscore Range.init(uncheckedBounds:) 2016-04-06 09:20:30 -07:00
practicalswift
abfecfde17 [gardening] if ([space]…[space]) → if (…), for(…) → for (…), while(…) → while (…), [[space]x, y[space]] → [x, y] 2016-04-04 16:22:11 +02:00
Dave Abrahams
a5c3c63c3d [stdlib] Indexing model: nix RangeOfStrideable
Instead, use CountableRange which is constrained to have a Strideable
Bound whose Stride conforms to Integer.
2016-03-28 17:06:09 -07:00
Dave Abrahams
01127b32d5 index(n, stepsFrom: i)
M-x findr-query-replace

\<advance(\([^:]+?\),\([
]+\)by: *\([^(),]*\|[^(),]+([^()]*)[^(),]*\)\(,\(?:[
]+\)limit: *\(?:[^()]*\|[^()]+([^()]*)[^()]*\)\)?)

index(\3,\2stepsFrom: \1\4)
2016-03-25 17:54:39 -07:00
Dave Abrahams
11259d1d14 [stdlib] indexing model: rename in-place indexing
This time, choose something that's at least compliant with the API
guidelines.
2016-03-23 17:16:20 -07:00
Bliss Chapman
37e3a79877 Remove escaped spaces from the MutableCollectionType’s partition method
documentation.
2016-03-23 11:02:46 -05:00
Dave Abrahams
8d9e62b274 [stdlib] indexing model: rename next/previous
I'm not too satisfied with the names for the updating: versions, but
this is a start.
2016-03-22 17:13:54 -07:00
Dmitri Gribenko
a6cd57222a Merge remote-tracking branch 'origin/master' into swift-3-indexing-model 2016-03-21 14:41:15 -07:00
Dave Abrahams
a9dd95c37a [stdlib] indexing model: Generic Mutable Slicing 2016-03-18 15:08:40 -07:00
Dave Abrahams
388833831b Balance parens in gyb file
It was messing with our editor's indentation to have unmatched parens in
gyb'd segments.
2016-03-18 15:05:12 -07:00
Nate Cook
afac511c19 [stdlib] Remove unavailable annotation for MutableCollection.sort() 2016-03-17 16:12:37 -05:00
Dave Abrahams
f493b54e44 [stdlib] indexing model: Interval/Range merge
This is step 1; we still need to introduce ClosedRange.
2016-03-16 15:59:10 -07:00
Dmitri Gribenko
95163c4813 stdlib: New indexing model: fix a new inout violation in Collection.partition() 2016-03-14 18:59:27 -07:00
Dmitri Gribenko
3cde854287 Merge remote-tracking branch 'origin/master' into swift-3-indexing-model 2016-03-12 01:11:32 -08:00
Daniel Duan
276370b599 [stdlib] apply SE-0040 to stdlib 2016-03-11 16:01:41 -08:00
Dmitri Gribenko
fc636b94f5 fixup 2016-03-06 02:12:59 -08:00
Dmitri Gribenko
ad1428e1d6 New collection indexing model: removed old index protocols
... and started to fix compiler errors.
2016-03-06 01:53:34 -08:00
Shawn Erickson
fe42606062 [stdlib] - WIP moved aspects of ForwardIndex and BidirectionalIndex into their Collection equivalents 2016-03-04 07:40:59 -08:00
Dmitri Gribenko
d7e82519f5 stdlib: add argument labels to sort() implementation details 2016-02-24 08:52:18 -08:00
Max Moiseev
85766f8db7 [stdlib] availability attributes for indexOf 2016-02-23 14:26:53 -08:00