Can I make two overloads such that one can take an argument from a “let”-mode
object or a regular function parameter and return an UnsafePointer and then
have the other take a “var”-mode object or inout function parameter and return
an UnsafeMutablePointer? I think this can be done in C++.
—
on Fri Jun 02 2017, Brent Royal-Gordon wrote:
>> On May 27, 2017, at 10:40 AM, Dave Abrahams via swift-evolution
> wrote:
>>
>> A property and an intializer will be added to `String.Index`, exposing
>> the offset of the index in code units
> On May 27, 2017, at 10:40 AM, Dave Abrahams via swift-evolution
> wrote:
>
> A property and an intializer will be added to `String.Index`, exposing
> the offset of the index in code units (currently only UTF-16) from the
> beginning of the string:
>
> ```swift
>
> On Jun 2, 2017, at 2:20 AM, Brent Royal-Gordon via swift-evolution
> wrote:
>
>> On May 28, 2017, at 11:37 PM, Daryle Walker via swift-evolution
>> > wrote:
>>
>> Static-Sized Arrays
>
> My preference
Thanks, added.
On Friday, June 2, 2017 1:18 PM, Vladimir.S wrote:
On 02.06.2017 2:34, Tommaso Piazza wrote:
> Is the version you suggest to add to my list for the Swift syntax currently
> valid as
> of SE-0110 in Swift 4?
Yes, just checked on latest dev snapshot of
> On Jun 1, 2017, at 10:49 PM, Daryle Walker via swift-evolution
> wrote:
>
> Current array literal syntax (i.e. “[a, b, c]”) works for dense and/or linear
> arrays, but isn’t so great later on when we add fixed-size arrays and the
> defined (non-zero) elements are
on Fri Jun 02 2017, Brent Royal-Gordon wrote:
>> On May 28, 2017, at 11:37 PM, Daryle Walker via swift-evolution
>> wrote:
>>
>> Static-Sized Arrays
>
> My preference would still be to build this from four separate features:
>
> 1. Magic
John and others, who are involved into this thread.
I'd suggest to clarify the current(Swift4) situation with function/closure type
before we make any other decision and before continue to discuss the subject.
(sorry for long email, but I feel the problem with SE-0110 is wider than just "let's
Sent from my iPad
> On Jun 2, 2017, at 7:33 AM, Xiaodi Wu via swift-evolution
> wrote:
>
>
> On Fri, Jun 2, 2017 at 04:28 Brent Royal-Gordon via swift-evolution
> wrote:
>>> On May 28, 2017, at 11:37 PM, Daryle Walker via
On Fri, Jun 2, 2017 at 04:28 Brent Royal-Gordon via swift-evolution <
swift-evolution@swift.org> wrote:
> On May 28, 2017, at 11:37 PM, Daryle Walker via swift-evolution <
> swift-evolution@swift.org> wrote:
>
> Static-Sized Arrays
>
> My preference would still be to build this from four separate
The key is to implement methods that deal with Self as protocol extensions. Not
*in* the protocol itself:
// YES
protocol DAOProtocol {
init()
}
extension DAOProtocol {
static func retOne() -> Self {return self.init()}
static func retMany() -> Array {
On 02.06.2017 2:34, Tommaso Piazza wrote:
Is the version you suggest to add to my list for the Swift syntax currently valid as
of SE-0110 in Swift 4?
Yes, just checked on latest dev snapshot of Swift 4.
On Thursday, June 1, 2017 9:32 PM, Vladimir.S wrote:
On 01.06.2017
> On 2 Jun 2017, at 07:38, Robert Bennett wrote:
>
> My favorite proposal so far is one that was posted a while ago, [Int * 4]. I
> think that this syntax looks pretty Swifty. There isn't an oddball subscript
> operator like with Int[4], and there isn't a need to allow
> 1. Magic tuple conformances: We already want to be able to automatically
> conform tuples to protocols like Equatable, Hashable, and Comparable. These
> can all be compiler magic; they don't have to be definable in userspace.
>
> 2. Conform tuples to Collection: The Element type should be the
*edit*
Actual protocol implementation:
protocol Selfie {
init()
}
extension Selfie {
static func retOne() -> Self {return self.init()}
static func retMany() -> Array { return [] }
static func retTuple() -> (Self, Int) { return (self.init(), 0) }
}
> On Jun 2, 2017, at 3:08 AM,
Wow, you’re right. Look like this is a bug? The issue shows up in class
definitions, not protocol definitions.
This works:
protocol Selfie {
static func retOne() -> Self
static func retMany() -> Array
static func retTuple() -> (Self, Int)
}
This doesn’t work:
class Selfie {
> On Jun 2, 2017, at 4:06 AM, Jaden Geller wrote:
>
> I don’t know if you’re aware, but you can extend arbitrary nominal types with
> literal syntax.
>
> ```
> extension FixedSizedArray: ExpressibleAsDictionaryLiteral { … }
> ```
>
> Nothing special needs to be done
Hello Zaid,
I don't know what prevents you from implementing your DAOs.
For an example of a library that uses them extensively, see
http://github.com/groue/GRDB.swift:
struct PointOfInterest {
var id: Int64?
var title: String?
var favorite: Bool
var
Just a small question, named tuples => Dictionary? Or how would that resolve?
> On Jun 2, 2017, at 2:20 AM, Brent Royal-Gordon via swift-evolution
> wrote:
>
>> On May 28, 2017, at 11:37 PM, Daryle Walker via swift-evolution
>>
New Spitball
But first:
C has one of the worst array presentation models. It has traumatized so many
that those among them that grew up to be language designers themselves threw
out fixed-sized arrays entirely (from Java to even current Swift!). But we’re
getting through to everyone that the
> On May 28, 2017, at 11:37 PM, Daryle Walker via swift-evolution
> wrote:
>
> Static-Sized Arrays
My preference would still be to build this from four separate features:
1. Magic tuple conformances: We already want to be able to automatically
conform tuples to
Greetings Swift Community,
Today I’m throwing out a pitch on freeing the shackles on Self. Self is a
potentially significant tool that I am itching to implement in my patterns to
make my code more concise, clear and intuitive.
Self, by far, is cherished by Data Models and ORM's, and
On Fri, Jun 2, 2017 at 1:53 AM, Jonathan Hull via swift-evolution <
swift-evolution@swift.org> wrote:
> I vote to revert it to current behavior. Then we can take time to come up
> with the correct answer for future Swift.
>
> If we don’t revert and then end up changing it again later, we will
Why would this not be possible with fixed sized arrays? Theoretically you could
create a type that wrapped a fixed array and make it conform to whatever
protocol you want, including the “ExpressibleBy” protocols.
> On Jun 2, 2017, at 12:22 AM, Daryle Walker wrote:
>
>>
>> On
> On Jun 2, 2017, at 3:56 AM, Jaden Geller wrote:
>
> Why would this not be possible with fixed sized arrays? Theoretically you
> could create a type that wrapped a fixed array and make it conform to
> whatever protocol you want, including the “ExpressibleBy”
I don’t know if you’re aware, but you can extend arbitrary nominal types with
literal syntax.
```
extension FixedSizedArray: ExpressibleAsDictionaryLiteral { … }
```
Nothing special needs to be done on the implementation side to make this
possible. If fixed sized arrays are not nominal types
> On Jun 2, 2017, at 2:11 AM, Jaden Geller wrote:
>
> Comments inline.
>
>> On Jun 1, 2017, at 10:49 PM, Daryle Walker via swift-evolution
>> > wrote:
>>
>> Current array literal syntax (i.e. “[a, b, c]”)
My favorite proposal so far is one that was posted a while ago, [Int * 4]. I
think that this syntax looks pretty Swifty. There isn't an oddball subscript
operator like with Int[4], and there isn't a need to allow generics to support
values as parameters. It's clear that [Int * 4] will be
Comments inline.
> On Jun 1, 2017, at 10:49 PM, Daryle Walker via swift-evolution
> wrote:
>
> Current array literal syntax (i.e. “[a, b, c]”) works for dense and/or linear
> arrays, but isn’t so great later on when we add fixed-size arrays and the
> defined
29 matches
Mail list logo