[swift-evolution] [Pitch] Replace 'inout' with '&'

Matthew Johnson matthew at anandabits.com
Mon Dec 21 12:27:23 CST 2015


> On Dec 21, 2015, at 12:25 PM, Joe Groff via swift-evolution <swift-evolution at swift.org> wrote:
> 
> 
>> On Dec 19, 2015, at 4:10 PM, Erica Sadun <erica at ericasadun.com <mailto:erica at ericasadun.com>> wrote:
>> 
>> What would the ramifications of the following be? Each addresses the "confusable with labeling" issue but preserve the inout keyword.
>> 
>> func foo(x: inout Int)
>> func foo(x: @inout(Int))
>> func foo(x: @inout Int)
>> 
>> Is there an underlying reason that parameter modification should live on the name side rather than the type side of the colon? They aren't really modifying the name
>> 
>> -- Erica, inexperienced with Rust
> 
> Putting `inout` after the colon feels good to me. Like Jordan said, it meshes better with the type syntax, (inout Int) -> (), too.
> 

+1.  I like it.

> -Joe
> 
> 
> _______________________________________________
> 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/20151221/5332bc01/attachment.html>


More information about the swift-evolution mailing list