I like this idea very much. I believe '&' should belong to instance variable, as it will be mutated, just like for inout parameter, so

c&.frobnicate(i)
let k = c&.frobnicate(&i)

very clear and explicit. Don't like the 'mutation' or even 'mut' as we'll have heavy code, as it is a word just like functions/methods/variable names and IMO harder to parse visually. '&' is a 'marker', that clearly parsed.

On 26.04.2016 16:48, Thorsten Seitz via swift-evolution wrote:

As an alternative to the mutate keyword I rather like using '&' because it
already means 'inout'. Using '&.' as mutating method call would therefore
be quite understandable.

c&.frobnicate(i)
let k = c&.frobnicate(&i)

Or marking the method like suggested elsewhere:

c.frobnicate&(i)
let k = c.frobnicate&(&i)

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

Reply via email to