[swift-evolution] What about a VBA style with Statement?
Thorsten Seitz
tseitz42 at icloud.com
Tue Apr 19 03:36:41 CDT 2016
-1
I can't see a significant advantage over using the library based approach where the receiver is clearly recognizable and no context problems arise.
-Thorsten
> Am 14.04.2016 um 19:03 schrieb Erica Sadun via swift-evolution <swift-evolution at swift.org>:
>
>
>> On Apr 14, 2016, at 10:42 AM, Jonathan Tang via swift-evolution <swift-evolution at swift.org> wrote:
>>
>>> On Thu, Apr 14, 2016 at 8:23 AM, Tino Heth via swift-evolution <swift-evolution at swift.org> wrote:
>>>
>>> > (in Smalltalk, like in Swift?, if i remember correctly, ‘self’ is implicitly
>>> > returned in absence of a return value and can be ignored.
>>> I'm a big fan of returning self — its much more useful than void…
>>> But it seems the Swift-community doesn't like method chaining.
>>
>> I dunno about that... AlamoFire and SwiftyJSON both use it, and are quite popular with rank-and-file Swift programmers. It's certainly not popular in the Objective-C community (where the syntax doesn't really support it), but it seems like the Swift community may be warming up to it.
>>
>> I also like the idea of a dedicated method-cascading operator, like what Dart has. It eliminates the need for a programmer to explicitly remember to 'return self' at the end of a chainable method. Not sure how well it'd integrate with SE-0047 (@discardableResult) though.
>
> Method cascades draft: https://gist.github.com/erica/6794d48d917e2084d6ed
>
> deferred to after 3.0
>
> -- E
>
>
>
> _______________________________________________
> swift-evolution mailing list
> swift-evolution at swift.org
> https://lists.swift.org/mailman/listinfo/swift-evolution
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20160419/37fbeba1/attachment.html>
More information about the swift-evolution
mailing list