<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=""><div class=""><br class=""></div><div><blockquote type="cite" class=""><div class="">On Jun 1, 2016, at 7:48 PM, Ricardo Parada via swift-evolution <<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><meta http-equiv="content-type" content="text/html; charset=utf-8" class=""><div dir="auto" class=""><div class=""><br class=""></div><div class="">On May 31, 2016, at 3:04 PM, Erica Sadun via swift-evolution <<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>> wrote:<br class=""><br class=""></div><blockquote type="cite" class=""><div class=""><font face="Menlo" class="">let _ = scaleAndCropImage(image: myImage, toSize: size, operation: .fill)</font></div><div class=""><br class=""></div><div class="">You would not be able to assign `.fill` to a variable and use that for the operation value.</div></blockquote><br class=""><div class="">This is my objection to this idea. It does not encourage reuse.</div></div></div></blockquote><div><br class=""></div><div>-1For me too. Introducing this quasi-enum would increase cognitive load with little, if any, net benefit. This is the sort of feature that looks great and works wonderfully in example apps, but does not scale well to real systems, where options show up in more methods through time, get passed around to helpers, stored, marshaled into various formats, etc.</div><div><br class=""></div><div>As someone mentioned, this would probably be a good fit If Swift adopts a structural type system (I suppose, I have ever used a language with one to my knowledge, unless duck typing counts)</div><div><br class=""></div><div>As syntactic sugar for a true enum declaration, it would be a “cool” feature, but reuse would still be problematic. </div><br class=""><blockquote type="cite" class=""><div class=""><div dir="auto" class=""><div class=""><br class=""></div><div class="">I would not be able to assign to a variable:</div><div class=""><br class=""></div><div class="">let <b class="">selectedOperation</b> = .fill</div><div class=""><br class=""></div><div class="">In order to then do this later in the program:</div><div class=""><br class=""></div><div class="">scaleAndCropImage(image: myImage, toSize: size, operation: <b class="">selectedOperation</b>)</div></div>_______________________________________________<br class="">swift-evolution mailing list<br class=""><a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a><br class="">https://lists.swift.org/mailman/listinfo/swift-evolution<br class=""></div></blockquote></div><br class=""></body></html>