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

Dmitri Gribenko gribozavr at gmail.com
Fri Dec 18 20:08:36 CST 2015

On Fri, Dec 18, 2015 at 5:23 PM, Joe Groff via swift-evolution <
swift-evolution at swift.org> wrote:

> For Swift 3, we're planning to phase out 'var' parameters in functions,
> and we're also making it so that language keywords are valid argument
> labels. With both of these changes pending, I have a hard time not reading:
> func foo(inout x: Int)
I don't think this would be a problem in practice since it is hard for me
to imagine an API that would use 'inout' as a label -- at least they would
spell it 'inOut' according to our API guidelines (but I really think they
should call it something else).

There's also a possibility that we add 'out' parameters in the future, and
if 'inout' would be spelled '&', then we would need to find another sigil
for 'out'.

So, overall, I don't support this.


(j){printf("%d\n",i);}}} /*Dmitri Gribenko <gribozavr at gmail.com>*/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20151218/a8c839d2/attachment.html>

More information about the swift-evolution mailing list