I am going to try to learn how to implement this and submit a proper proposal.
> On 7 Oct 2017, at 15:07, James Valaitis wrote:
>
> Is it widely agreed that it is necessary to require a return statement on a
> one line property getter?
>
> var session: AVCaptureSession
Will this finally bring labels back everywhere (closures and stored
functions too)? :D.
On Thu, Oct 12, 2017 at 3:03 PM, Jeremy Pereira via swift-evolution <
swift-evolution@swift.org> wrote:
>
>
> >
> > I’m minorly opposed, because it feels like a slippery slope. What about
> function bodies?
>
> I’m minorly opposed, because it feels like a slippery slope. What about
> function bodies? etc
>
> func foo() -> Int { 3 } // should this be allowed?
Yes, why not? What is fundamentally different about a function body compared to
a getter body (or a closure body ;-)) that means, if we
On Tue Oct 10 15:02:37 CDT 2017 Slava Pestov spestov at apple.com wrote:
>> I’m minorly opposed, because it feels like a slippery slope. What about
function bodies? etc
>>
>> func foo() -> Int { 3 } // should this be allowed?
a small -1
or even:
func foo() { 3 } // Int return type inferred as
> On Oct 10, 2017, at 1:00 PM, Slava Pestov wrote:
>
>>
>> On Oct 9, 2017, at 10:54 AM, Jordan Rose wrote:
>>
>>
>>
>>> On Oct 8, 2017, at 21:56, Slava Pestov via swift-evolution
>>> wrote:
>>>
>>>
>>>
On Oct 7,
> On Oct 9, 2017, at 10:54 AM, Jordan Rose wrote:
>
>
>
>> On Oct 8, 2017, at 21:56, Slava Pestov via swift-evolution
>> wrote:
>>
>>
>>
>>> On Oct 7, 2017, at 7:07 AM, James Valaitis via swift-evolution
>>>
So you’re saying the core team _might_ consider a review if we’ve get a full
proposal + implementation in Swift 5 timeframe?
If yes, we only would need someone to implement my proposal. :)
Am 9. Oktober 2017 um 19:54:50, Jordan Rose via swift-evolution
(swift-evolution@swift.org) schrieb:
> On Oct 8, 2017, at 21:56, Slava Pestov via swift-evolution
> wrote:
>
>
>
>> On Oct 7, 2017, at 7:07 AM, James Valaitis via swift-evolution
>> wrote:
>>
>> Is it widely agreed that it is necessary to require a return statement on a
Even I would personally want this, this request didn’t made into Swift 3, nor
in Swift 4 and is clearly out of scope for Swift 5.
You can read my proposal here which includes all areas where this could be
allowed:
> On Oct 7, 2017, at 12:22 PM, Tony Allevato via swift-evolution
> wrote:
>
> I think the important thing to consider is, what advantage would such a
> feature provide *other* than to reduce keystrokes? (I don't personally think
> that optimizing for keys pressed by
> On Oct 7, 2017, at 7:07 AM, James Valaitis via swift-evolution
> wrote:
>
> Is it widely agreed that it is necessary to require a return statement on a
> one line property getter?
>
> var session: AVCaptureSession { get { return layer.session } }
>
> Or could
> On 7 Oct 2017, at 19:22, Tony Allevato via swift-evolution
> wrote:
>
> I think the important thing to consider is, what advantage would such a
> feature provide *other* than to reduce keystrokes? (I don't personally think
> that optimizing for keys pressed by
I think the important thing to consider is, what advantage would such a
feature provide *other* than to reduce keystrokes? (I don't personally
think that optimizing for keys pressed by itself should be a goal.)
In the case of closures, single expression closures without "return"
improve
On Sat, Oct 7, 2017 at 11:24 AM, Xiaodi Wu wrote:
> This has been brought up on the list before. For instance:
>
> https://github.com/apple/swift-evolution/pull/608
>
> Chris Lattner’s response at that time was:
>
> ‘Just MHO, but I consider this syntactic sugar, not a
For what it's worth, you can drop the "get" part for read-only computed
properties and write:
var session: AVCaptureSession { return layer.session }
On Sat, Oct 7, 2017 at 7:07 AM James Valaitis via swift-evolution <
swift-evolution@swift.org> wrote:
> Is it widely agreed that it is
This has been brought up on the list before. For instance:
https://github.com/apple/swift-evolution/pull/608
Chris Lattner’s response at that time was:
‘Just MHO, but I consider this syntactic sugar, not a fundamental feature
that fits the goal of Swift 4 stage 2.
‘I’m also pretty opposed to
+1
We don’t need “return” in single-line closures where the type is known, and
I don’t see why it is required in single-line getters.
Nevin
On Sat, Oct 7, 2017 at 10:07 AM, James Valaitis via swift-evolution <
swift-evolution@swift.org> wrote:
> Is it widely agreed that it is necessary to
Is it widely agreed that it is necessary to require a return statement on a one
line property getter?
var session: AVCaptureSession { get { return layer.session } }
Or could we follow the convention for any other close and get rid of it? For me
it seems redundant; the word `get` literally
18 matches
Mail list logo