[swift-evolution] mutating/non-mutating suggestion from a Rubyist

Xiaodi Wu xiaodi.wu at gmail.com
Mon Apr 25 17:43:31 CDT 2016


Me:

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?

You:

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
rejection, no?)
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
> has
> >     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
> happened?
>
> --
> Dave
>
> _______________________________________________
> 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/20160425/d5324568/attachment.html>


More information about the swift-evolution mailing list