[swift-evolution] mutating/non-mutating suggestion from a Rubyist
Dave Abrahams
dabrahams at apple.com
Mon Apr 25 18:21:25 CDT 2016
on Mon Apr 25 2016, Xiaodi Wu <xiaodi.wu-AT-gmail.com> wrote:
> 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?)
Hey, that was just my opinion at the time; that doesn't mean the
community rejected the idea or the core team rejected the idea [or even
that I still believe the same thing this week ;-)]
--
Dave
More information about the swift-evolution
mailing list