> Le 16 mars 2016 à 15:36, Chris Lattner via swift-evolution 
> <[email protected]> a écrit :
> 
> Hello Swift community,
> 
> The review of “Defaulting non-Void functions so they warn on unused results” 
> begins now and runs through March 21, 2016. The proposal is available here:
> 
>       
> https://github.com/apple/swift-evolution/blob/master/proposals/0047-nonvoid-warn.md
> 
> Reviews are an important part of the Swift evolution process. All reviews 
> should be sent to the swift-evolution mailing list at:
>       https://lists.swift.org/mailman/listinfo/swift-evolution
> 

One advantage that I see with the alternative of decorating the return type 
with @discardable, is that the attribute could be reused later if/when the 
out-only function parameters come to the language.

Something like:

func head(count: Int, tail: @discardable out String) -> String

To allow it to be safely called either as:

head = str.head(count:10, tail:&_)
head = str.head(count:10)

No need to discuss this possible usage now, just something to keep in mind when 
choosing the syntax.


Dany

_______________________________________________
swift-evolution mailing list
[email protected]
https://lists.swift.org/mailman/listinfo/swift-evolution

Reply via email to