<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Apr 3, 2016, at 1:56 PM, Shawn Erickson <<a href="mailto:shawnce@gmail.com" class="">shawnce@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><br class=""><br class=""><div class="gmail_quote"><div dir="ltr" class="">On Sun, Apr 3, 2016 at 1:27 PM Shawn Erickson <<a href="mailto:shawnce@gmail.com" class="">shawnce@gmail.com</a>> wrote:<br class=""></div><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex;"><div dir="ltr" class=""><div class="gmail_quote"><div dir="ltr" class="">On Sun, Apr 3, 2016 at 6:41 AM Michel Fortin via swift-evolution <<a href="mailto:swift-evolution@swift.org" target="_blank" class="">swift-evolution@swift.org</a>> wrote:<br class=""></div><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex;">> What is your evaluation of the proposal?<br class=""><br class="">I don't like "form" as a prefix. To me there is no difference between `union` and `formUnion`: both sounds functional-style, and actually the second one perhaps a bit more to my ears. There's basically two dictionary definitions of "form":<br class=""><br class="">1. "bring together parts or combine to create (something)" which to me implies a new value is created, and<br class="">2. "make or fashion into a certain shape or form" which would imply that the material you start with is transformed, which is apparently the intended meaning and also the reverse meaning from the above.<br class=""><br class="">I mean, doesn't this make sense as an API?<br class=""><br class=""> <span class="Apple-converted-space"> </span>let donut = baker.formDonut(dough) // non-mutating<br class=""><br class="">Perhaps instead of "form" we could use "become" as a prefix when the operation is naturally described by a noun. That would seem less ambiguous to me:<br class=""><br class=""> <span class="Apple-converted-space"> </span>a.becomeUnion(b)<br class=""> <span class="Apple-converted-space"> </span>a.becomeIntersection(b)<br class=""> <span class="Apple-converted-space"> </span>a.becomeSuccessor(b)<br class=""><br class="">It's a bit passive, but I find it fits well when the operation is a noun.<br class=""><br class="">And there's no way the term lends itself to non-mutating cases without things becoming nonsensical:<br class=""><br class=""> <span class="Apple-converted-space"> </span>let donut = baker.becomeDonut(dough) // non-mutating?<br class=""></blockquote><div class=""><br class=""></div></div></div><div dir="ltr" class=""><div dir="ltr" class=""><div class="gmail_quote"><div class="">I also am having difficulty coming to terms with the use of "form" (I am a native English speaker). As you note "form" can imply the creation of something from parts (more like assembling a new thing) as well as the creation of something out of a material say a of block clay (more like molding something out of an existing thing). It doesn't seem clear cut to me to imply in place mutation.</div><div class=""><br class=""></div><div class="">Additionally my eyes / brain keep seeing "from" instead of "form". This type of issue is generally true with any short word made up of the same set of letters (made worse since "from" is more common in programming then "form"). The mind quickly narrows in on a set of possible words given the letters we see and then uses context to help get the correct one and/or additional visual parsing to understand the exact ordering of letters (more energy expended). Anyway since I keep seeing "from" instead of "form" I keep going in the direction of thinking it returns something made from the two (or more) items involved (not really sure why "from" goes that direction in my head, it could also go the in place direction).</div><div class=""><br class=""></div><div class="">I would prefer something other then "form" (note I just typed "from" by mistake)... I think your suggestion of "become" has merit.</div><div class=""><br class=""></div><div class="">y.becomeUnion(x) --reads to me as--> "y become union with x"</div><div class="">y.formUnion(x) --read to me as--> "y from oops... y forming a union of x"</div><div class="">y.becomeI<span style="" class="">ntersection</span>(x) --reads to me as--> "y become intersection with x"</div><div class=""></div><div class="">y.form<span style="" class=""><span style="" class="">I</span><span style="" class="">ntersection</span></span>(x) --read to me as--> "y from oops... y forming an intersection with x"</div></div></div></div></blockquote><div class=""><br class=""></div><div class="">After stepping away for a bit and looking at it from the POV of the API of Set and not in the context of "y" I could read things in the abstract as...</div><div class=""><br class=""></div><div class="">"becomeUnion(with other:Self)" --> <span style="" class="">"I become a union with other"</span></div><div class="">"formUnion(with other:Self)" --> <span style="" class="">"I form a union with other"</span></div><div class=""><br class=""></div><div class="">No clear winner to me however when used in code "become" still feels more strongly mutating then "form": y.formUnion(with:x) or y.becomeUnion(with:x)</div><div class=""><br class=""></div><div class="">All in all the API would have mutating in front of it (at least for structs) and it wouldn't have a return type. It would become clear fairly quickly as a result (hence learned).</div><div class=""><br class=""></div><div class="">Just still not that happy with "form" but with use my mind would likely quickly adapt.</div></div></div></div></blockquote><br class=""></div><div>I think the best English verb for this construction is “emplace”:</div><div><br class=""></div><div><span class="Apple-tab-span" style="white-space:pre">        </span><a href="http://www.dictionary.com/browse/emplace" class="">http://www.dictionary.com/browse/emplace</a></div><div><br class=""></div><div>It means “to put in position”, and is always used with an object (the noun). It’s basically free from incorrect connotations because it’s obscure enough that most English speakers won’t know it, and is easily searchable for English- and non-English speakers alike.</div><div><br class=""></div><div><span class="Apple-tab-span" style="white-space:pre">        </span>- Doug</div><div><br class=""></div></body></html>