Max Moiseev
2c9be47551
Merge branch 'master' into new-integer-protocols
2017-03-23 16:46:01 -07:00
Doug Gregor
388f0c505e
[Stdlib] Eliminate explicit constraints made redundant by inferred ones.
2017-03-22 17:35:12 -07:00
Max Moiseev
b9fb3badc8
Merge remote-tracking branch 'origin/master' into new-integer-protocols
2017-03-22 12:30:24 -07:00
Roman Levenstein
29ad714bb7
Annotate stdlib functions to get a good performance even in resilient mode, when -sil-serialize-all is disabled
...
This commit mostly improves the performance of arrays and ranges.
It does not cover Strings, Dictionaries and Sets yet.
2017-03-16 19:46:11 -07:00
Max Moiseev
27889c6376
Merge remote-tracking branch 'origin/master' into new-integer-protocols
2017-01-06 15:54:44 -08:00
practicalswift
6d1ae2a39c
[gardening] 2016 → 2017
2017-01-06 16:41:22 +01:00
Ben Cohen
28114baeb9
Flag various FIXMEs as ABI-impacting
2017-01-03 18:36:20 -08:00
Max Moiseev
70b2343626
Merge branch 'master' into new-integer-protocols
2016-11-28 15:25:01 -08:00
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
Max Moiseev
6803cda05c
Merge branch 'master' into new-integer-protocols
2016-09-26 11:39:46 -07:00
Nicholas Maccharoli
731df181eb
[stdlib] Refactor logic for .pastEnd index check. ( #4957 )
2016-09-23 15:33:53 -07:00
Max Moiseev
ea8e0f0e15
Merge remote-tracking branch 'origin/master' into new-integer-protocols
2016-09-21 14:48:35 -07:00
airspeedswift
ed5231b47c
Numbered all FIXME(ABI) entries for tracking purposes. ( #4868 )
2016-09-19 16:41:41 -07: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
Max Moiseev
1867ca4a0f
WIP eliminating compilation errors one by one...
2016-07-29 13:31:21 +03:00
Patrick Pijnappel
2728bd0145
[stdlib] Standardize function signature spacing
2016-07-23 11:51:32 +10:00
Doug Gregor
778e76e158
[SE-0091 Follow-up] Move more operators into types, now for generic operators.
2016-07-21 12:54:27 -07:00
Joe
a6dad0091b
[SE-0095] Initial parsing implementation for '&' composition syntax
...
This commit defines the ‘Any’ keyword, implements parsing for composing
types with an infix ‘&’, and provides a fixit to convert ‘protocol<>’
- Updated tests & stdlib for new composition syntax
- Provide errors when compositions used in inheritance.
Any is treated as a contextual keyword. The name ‘Any’
is used emit the empty composition type. We have to
stop user declaring top level types spelled ‘Any’ too.
2016-07-19 12:01:02 -07:00
practicalswift
5d1af107a3
[gardening] Use "{let,var} c: C" instead of "{let,var} c : C"
...
Inspired by @gribozavr:s fix in 1ad666742e
2016-07-01 23:51:32 +02:00
Austin Zheng
9138b73097
[stdlib] Addressing Dmitri Gribenko's feedback re #2993
...
Changes:
- Moved only-used-once helper methods into call sites
- Parameterized tests that might expect a crash
- Fixed some comments and formatting; renamed some test helper APIs
2016-06-17 00:26:27 -07:00
Austin Zheng
6231cca609
[stdlib] Implementing O(1) methods on CountableClosedRange ( #2993 )
...
* [stdlib] Implementing O(1) methods on `CountableClosedRange`
Changes:
- Implemented O(1) `index(_:offsetBy:)` and `distance(from:to:)` methods on `CountableClosedRange`
- Fixed some unit tests
- Added many more unit tests for Countable*Range index APIs
* Clarify test intent
2016-06-16 21:08:13 -07:00
Rintaro Ishizaki
668b9dbc64
[stdlib] Apply tail style "where" clause to stdlib/public/core
2016-06-02 12:00:55 +09:00
Nate Cook
44b2d56a7f
[stdlib] Revise documentation for string-related types
...
This documentation revision covers a large number of types & protocols:
String, its views and their indices, the Unicode codec types and protocol,
as well as Character, UnicodeScalar, and StaticString, among others.
This also includes a few small changes across the standard library for
consistency.
2016-05-22 03:04:22 -05:00
Max Moiseev
7ac6c041f9
[stdlib] @available attributes for startIndex/endIndex on ranges
2016-05-20 13:47:50 -07: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
Slava Pestov
ce0b51cc9b
Update resilience annotations in stdlib for recent changes
...
The new indexing model and floating point stuff was missing a few
annotations, causing a build failure with -enable-resilience.
2016-05-11 22:51:33 -07:00
Max Moiseev
d00dddbdab
[stdlib][swift-3-indexing-model] fixing the ReversedCollection/lazy test
2016-04-29 13:46:50 -07:00
Dave Abrahams
9bee5d182f
[stdlib] location/formLocation => index/formIndex
2016-04-26 17:46:16 -07: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
41e94ac655
stdlib: fix a bug in CountableClosedRange._customContainsEquatableElement() and add better tests for range types
...
The tests are still not thorough enough, but this is a start.
2016-04-21 14:00:18 -07:00
Dmitri Gribenko
14bb1ebf03
stdlib: ranges: move common printing and reflection code to protocols that exist solely for implementation sharing
...
We usually don't put descriptions and mirrors into default
implementations, but these protocols are special because users are not
allowed to declare conformances to them.
2016-04-20 11:37:39 -07:00
Dmitri Gribenko
94964eccb8
stdlib: ranges: remove duplicate code
...
These definitions already exist in protocols for ranges.
2016-04-20 11:01:47 -07:00
Dmitri Gribenko
1aeccae6e8
stdlib: ranges: add the cheapest possible implementations of isEmpty
...
These methods are not protocol extensions because the protocol
extensions would need ambiguity breakers between Collection and range
protocols anyway.
2016-04-20 10:37:01 -07:00
Dmitri Gribenko
989ec9af8d
stdlib: coding style (consistency with DictionaryIndex)
2016-04-18 17:15:09 -07:00
Dmitri Gribenko
3d4378c86c
stdlib: add ABI fixmes
2016-04-18 17:15:09 -07:00
Dmitri Gribenko
10697f939f
Merge commit '510f29abf77e202780c11d5f6c7449313c819030' into swift-3-indexing-model
2016-04-14 13:45:27 -07:00
Dave Abrahams
6e75d97f00
[stdlib] Clean up redundant protocol conformance
2016-04-10 11:50:19 -07:00
Nate Cook
f947c7c81c
[New indexing model] Finish documentation revisions
...
- Replaced RandomAccessIndex mentions from Strideable documentation
with stronger guarantees if Stride conforms to Integer.
- Other cleanup and revisions.
2016-04-08 14:04:34 -05:00
Nate Cook
afd064a335
[New indexing model] Revisions to range documentation
2016-04-08 00:59:26 -05:00
Nate Cook
d663e7ead0
[New indexing model] Revise documentation for closed ranges
2016-04-07 16:54:22 -05:00
Dave Abrahams
94771b4a39
[stdlib] Update indexing model doc comments
...
Also fix some diagnostics
2016-04-06 17:34:00 -07:00
Dave Abrahams
9bbb01b70e
[stdlib] WIP updating ClosedRange comments.
2016-04-06 11:03:04 -07:00
Dave Abrahams
fa1538cd70
[stdlib] Make ClosedRange == more generic
...
This enables equality comparison of ClosedRange<T> and CountableClosedRange<T>.
2016-04-06 11:03:04 -07:00
Dave Abrahams
5864117b1b
[stdlib] De-underscore Range.init(uncheckedBounds:)
2016-04-06 09:20:30 -07:00
Dave Abrahams
db03708a3d
[stdlib] De-underscore Range protocols
...
There's really no excuse for keeping these hidden; they appear in public
APIs.
2016-04-05 16:32:15 -07: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
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
55885fb5ed
New indexing model: tighten requirements on SubSequence types
2016-03-22 15:02:45 -07:00