Commit Graph

185 Commits

Author SHA1 Message Date
practicalswift
797b80765f [gardening] Use the correct base URL (https://swift.org) in references to the Swift website
Remove all references to the old non-TLS enabled base URL (http://swift.org)
2016-11-20 17:36:03 +01:00
Nate Cook
534bea8f9f [stdlib] Update revisions with feedback 2016-11-15 15:00:10 -06:00
Nate Cook
bd6025f463 [stdlib] Various documentation fixes
- Fix incorrect type in Float(_:String) examples
- Expand discussions for ExpressibleBy_Literal protocols
- Add notes about non-escaping unsafe pointers from closures
- Add note about isEmpty to Collection.count discussions
- Describe imported `Bool` types
- Clean up some floating point discussions
- Provide some additional operator documentation
- Revise documentation for CVarArg functions
- Fix incorrect Set method parameter descriptions
- Clarify array bridging behavior
- Add collection subscript complexity notes
2016-11-11 11:23:49 -06:00
Dave Abrahams
be1f95a65b [stdlib] Simplify expressions
Overload resolution is still slow, so these simple changes make a >10%
difference in compilation time.
2016-10-11 10:07:21 -07:00
airspeedswift
ed5231b47c Numbered all FIXME(ABI) entries for tracking purposes. (#4868) 2016-09-19 16:41:41 -07:00
practicalswift
fa7fbdb8b0 [gardening] Remove redundant nil-initialization of optional variable
From the Swift documentation:

"If you define an optional variable without providing a default value,
 the variable is automatically set to nil for you."
2016-09-18 07:40:07 +02:00
Dmitri Gribenko
92c180031f stdlib: make 'Sequence.first(where:)' a pure protocol extension (no dynamic dispatch)
SE-0032 did not propose a protocol entry point, only a protocol
extension.

Using a pure protocol extension is the right choice here because a
concrete sequence can't provide a more efficient implementation of this
method than the default one.
2016-09-09 11:30:55 -07:00
Toni Suter
c11ae52e03 Fix wrong parameter name in documentation comment 2016-09-05 16:44:59 +02:00
Robert Widmann
740721ab2f Address Dmitri's comments on #3600 2016-08-16 23:59:00 -07:00
Robert Widmann
e6c313bce3 Merge pull request #3600 from russbishop/se0045
[SR-1516][stdlib] Implement SE-0045 prefix(while:) and drop(while:)
2016-08-16 16:26:21 -07:00
Russ Bishop
f0e6c306e4 [stdlib][SE-45] Add prefix(while:) and drop(while:) to Sequence
Includes lazy implementation courtesy of Nate Cook
2016-08-15 14:13:27 -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
8b39706c3f [stdlib] Documentation revisions
- Various edits
- Standardized complexity formatting
2016-08-12 12:24:36 -05:00
Rintaro Ishizaki
5b8a78473e stdlib: Fix-it for underestimateCount() renaming
underestimateCount() has been replaced by underestimatedCount property.
2016-08-09 21:00:33 +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
Jacob Bandes-Storch
301c0688dc Merge branch 'master' into se-0133 2016-07-28 11:46:03 -07:00
Nate Cook
58fb4ef9c5 [stdlib] Clean up various documentation issues (#3804)
* [stdlib] Clean up some documentation formatting

* [stdlib] Update example code for SE-0103

* [stdlib] Fix UnsafeBufferPointer documentation typo

* [stdlib] Collection documentation cleanup

* [stdlib] Fix String.init?(_:UTF16View) description

* [stdlib] Documentation fixes for SE-0091

* [stdlib] Add param info for String(repeating:count:)
2016-07-28 11:25:38 -07:00
Jacob Bandes-Storch
039ad2bf09 [stdlib] Rename flatten() to joined() (SE-0133) 2016-07-27 23:19:31 -07:00
Dave Abrahams
4fa5877f4f [stdlib] Fix some examples in doc comments 2016-07-19 14:44:25 -07:00
Dave Abrahams
b2bbd4c599 reduce(_ initial:combine:) => reduce(_ initialResult:_ nextPartialResult) 2016-07-19 07:12:59 -06:00
Dave Abrahams
5a5f19aa45 first/contains(predicate) => first/contains(where: predicate) 2016-07-19 07:12:59 -06:00
Dave Abrahams
dcbfdb5339 _ includeElement/whereElementsSatisfy predicate => _ isIncluded 2016-07-19 07:05:54 -06:00
Dave Abrahams
4b072f630c _ isSeparator: => whereSeparator isSeparator: 2016-07-19 07:05:53 -06:00
Andrew Trick
73106dd7c3 Rename initialize(with:count:) to initialize(to:count:). (#3601)
As proposed in SE-0107: UnsafeRawPointer.

"with" is considered a vacuous preposition. "to" implies direction.
2016-07-18 23:37:45 -07:00
Michael Gottesman
fc37603c5f Revert "Implement SE-0118" 2016-07-18 16:44:58 -07:00
Dave Abrahams
b0044948df reduce(_ initial:combine:) => reduce(_ initialResult:_ nextPartialResult) 2016-07-18 14:30:46 -06:00
Dave Abrahams
7987b8549b first/contains(predicate) => first/contains(where: predicate) 2016-07-18 14:29:09 -06:00
Dave Abrahams
4bb21b8a2f _ includeElement/whereElementsSatisfy predicate => _ isIncluded 2016-07-18 14:29:09 -06:00
Dave Abrahams
5fdbd162da _ isSeparator: => whereSeparator isSeparator: 2016-07-18 14:29:08 -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
Doug Gregor
823c24b355 [SE-0112] Rename ErrorProtocol to Error.
This is bullet (5) of the proposed solution in SE-0112, and the last
major piece to be implemented.
2016-07-12 10:53:52 -07:00
Dmitri Gribenko
824bccc871 stdlib: change Collection._copyToNativeArrayBuffer() to be defined in terms of public types 2016-07-11 10:54:43 -07:00
Luciano Marisi
360b07550d Fixed incorrect reference name of CountdownIterator on Sequence documentation 2016-07-02 19:01:20 +01: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
Nate Cook
4aaa31efbd [stdlib] Fix and clean up 'split' documentation
* Collection's default implementation for
  split(separator:maxSplits:omittingEmptySubsequences:) had the wrong
  version of the documentation.
* Some parameter docs were missing default values.
* Fixed an indentation issue.
* Reviewed the post-index-change TODO comments throughout
  Collection.swift.
2016-06-23 16:02:40 -05:00
Patrick Pijnappel
daec2dae00 Resolve conflicts with master 2016-05-24 19:21:04 +02: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
Nate Cook
982e3d09f8 [stdlib] Revise documentation for new indexing model
This revises and expands on documentation for the new collection methods
for working with indices and the revised Swift 3 set APIs. In addition,
it includes documentation for the new range types.
2016-05-19 10:16:14 -05:00
Russ Bishop
6fd60c6de6 Style adjustments 2016-05-15 00:39:56 -07:00
Russ Bishop
1f88150b79 Use forEach() and fix tests 2016-05-14 23:32:41 -07:00
Russ Bishop
f20c9255e9 Changes for code review 2016-05-14 16:57:00 -07:00
Russ Bishop
1d8edfa60f SR-1519: Add Sequence.first(predicate:) 2016-05-13 23:46:05 -07:00
Dmitri Gribenko
d079c992ea Merge pull request #2504 from apple/stdlib-use-underscore-precondition
stdlib: use _precondition(), not precondition()
2016-05-12 18:53:22 -07:00
Dmitri Gribenko
a8f076d7f0 stdlib: use _precondition(), not precondition()
precondition(), when used in the standard library, does not respect the
debug/release build setting of the module or application importing the
standard library.
2016-05-12 16:13:41 -07:00
Trent Nadeau
6e327b4ddb Updated stdlib to use @discardableResult and _ = . 2016-05-11 22:53:37 -04:00
Dmitri Gribenko
405fb1339d Merge pull request #2329 from Nirma/sequence_fix
[stdlib] Simplification of split function
2016-05-10 21:40:17 -07:00
Patrick Pijnappel
4419614be4 Move post-nil guarantee to separate line for Iterators' next() 2016-05-08 21:36:39 +02:00
Nicholas Maccharoli
efb340c228 [stdlib] Simplification of split function 2016-05-08 22:23:37 +09:00