[swift-evolution] ed/ing, InPlace, Set/SetAlgebra naming resolution

Dave Abrahams dabrahams at apple.com
Mon Feb 15 11:29:48 CST 2016


on Mon Feb 15 2016, Thorsten Seitz <swift-evolution at swift.org> wrote:

> We might also have just mutating versions as methods and nonmutating versions as global functions, i.e.
>
> a.union(b) // mutating
> let c = union(a, b) // non-mutating

Personally, I would rather avoid math terms altogether than make "union" a
mutating operation, because it violates expectations for this operation.
That leaves the door wide open for anyone who wants a more traditional
mathematical interface to define it in an extension, using "InPlace" or
whatever else is necessary.


-- 
-Dave



More information about the swift-evolution mailing list