[swift-evolution] mutating/non-mutating suggestion from a Rubyist
xiaodi.wu at gmail.com
Mon Apr 25 17:43:31 CDT 2016
Unless the functions also return an error, mutating/non-mutating pairs
of functions return Void/Self (or maybe Optional<Self>) respectively.
Are there other possibilities? But Swift is pretty unique among
C-family languages in allowing overloaded functions that differ only
by return type. Besides the loss of clarity to the reader at the call
site, what are downsides of simply naming both functions exactly the
same in today's Swift syntax?
I don't think it's really worth exploring much further once you acknowledge
the loss of clarity to the reader at the call site ;-)
(I think the smiley really seals the deal in terms of definitiveness of
On Mon, Apr 25, 2016 at 17:05 Dave Abrahams via swift-evolution <
swift-evolution at swift.org> wrote:
> on Sun Apr 24 2016, Xiaodi Wu <swift-evolution at swift.org> wrote:
> > Anyways, I wouldn’t be surprised if this idea has come up before and
> > been rejected, but to me it sounds like a good idea.
> > Yes, I suggested this a while back, and it was rejected.
> That makes it sound much more definitive than anything on this list
> other than a formal review response can ever be. What actually
> swift-evolution mailing list
> swift-evolution at swift.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the swift-evolution