<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto"><div><span></span></div><div><div>Ohh... I get it. We are saying the same thing, just differently. You look at source code then SIL and see that the SIL form is the same, which you formulate as they are the same for the compiler. The same situation is what i refer to as unique: the compiler does not realize what you did.. It simply did the work many times, producing the same code over and over. I call this "each one is unique".</div><div><div><br></div>On Jun 2, 2016, at 6:03 PM, Félix Cloutier <<a href="mailto:felixcca@yahoo.ca">felixcca@yahoo.ca</a>> wrote:<br><br></div><blockquote type="cite"><div><meta http-equiv="Content-Type" content="text/html charset=utf-8">You talked about the "compiler's point of view" and said about tuples that "the compiler never thinks that they are the same type". At which level is that true if we're not talking about the internal workings of the compiler?<div class=""><br class=""></div><div class="">There is consensus that Swift does not currently allow enums to be defined like tuples. Of course this is not how things work currently; </div></div></blockquote><div><br></div><div>To me the double negative translates to "of course the compiler currently allow enum to be defined like tuples". Am I understanding it correctly?</div><div><br></div><div>If u want yo see how far the differences go, u may want to try to create tiny app with one enum then one with one tuple, then inspect the binaries.</div><br><blockquote type="cite"><div><div class="">we wouldn't be having a proposal otherwise! I don't see what this adds to the conversation. You could use that argument against any idea of future development.<br class=""></div></div></blockquote><div><br></div><div>Could, but hopefully never actually would, right!?</div><br><blockquote type="cite"><div><div class=""><div class="">
<br class="Apple-interchange-newline"><span style="color: rgb(0, 0, 0); font-family: 'Lucida Grande'; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; display: inline !important; float: none;" class="">Félix</span>
</div>
<br class=""><div><blockquote type="cite" class=""><div class="">Le 1 juin 2016 à 23:25:10, L Mihalkovic <<a href="mailto:laurent.mihalkovic@gmail.com" class="">laurent.mihalkovic@gmail.com</a>> a écrit :</div><br class="Apple-interchange-newline"><div class=""><meta http-equiv="Content-Type" content="text/html charset=utf-8" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div class=""><blockquote type="cite" class=""><div class="">On Jun 2, 2016, at 8:04 AM, Félix Cloutier <<a href="mailto:felixcca@yahoo.ca" class="">felixcca@yahoo.ca</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><meta http-equiv="Content-Type" content="text/html charset=windows-1252" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class="">I was once relying on the state of things to judge the validity of some access modifier claims and I was rebuked on the grounds that proposals should be evaluated based on their merits, not on implementation details.</div><div class=""><br class=""></div><div class="">And as far as implementation details go, this doesn't match what I understand of tuples. Looking at SIL, tuple types from different declarations appear just as identical as they do in source code. In fact, the output is exactly the same even when using a tuple typealias. Do you have an experiment or compiler code that would support your claims?</div></div></div></blockquote><div class=""><br class=""></div><div class="">I do not understand your question as it is formulated. What I described is the external behavior. I did not make any reference to the internal structure of the C++ that has managed to make heavy reuse of certain concepts across the whole type system, so indeed part of the differences we perceive at the language level do not exist identically at the implementation level. A fact remains, the language is defined by its grammar… and the grammar chose to expose certain concepts through what we know as <b class="">struct</b>, <b class="">class</b>, <b class="">enum, tuple</b>. Swift could have decided to offer a single Ω data type that would have displayed the behavior of all it current user defined types depending on where it was used. but that would not be swift, right?!</div><div class=""><br class=""></div><blockquote type="cite" class=""><div class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class=""><span style="font-family: 'Lucida Grande'; font-size: 12px; font-style: normal; font-variant-ligatures: normal; font-variant-position: normal; font-variant-caps: normal; font-variant-numeric: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-weight: normal; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">Félix</span>
</div>
<br class=""><div class=""><blockquote type="cite" class=""><div class="">Le 1 juin 2016 à 22:35:21, L Mihalkovic via swift-evolution <<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>> a écrit :</div><br class="Apple-interchange-newline"><div class=""><meta http-equiv="Content-Type" content="text/html charset=windows-1252" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div class=""><blockquote type="cite" class=""><div class="">On Jun 1, 2016, at 11:20 PM, Vladimir.S <<a href="mailto:svabox@gmail.com" class="">svabox@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div class="">OK, I understand most of your points and feel the same regarding the proposed feature... but:<br class=""><br class="">> .. the compiler does not like when we define the same thing twice, and thse short form amount to doing what he does not let us do. ..<br class="">> .. if we use an annotation that lets it know that "it is not a mistake..<br class="">> I really dont want to write that enum myself, even though I am using the<br class="">> same abbreviation twice". Otherwise, the compiler would let us know that<br class="">> the second time could be a mistake because there is already something<br class="">> with the same name...<br class=""><br class="">I just wanted to understand how such enums are different than tuples in meaning of "I don't want to write the struct myself", "Yes, I'm using the same tuple twice", "Compiler will let us know that we used the same tuple again and probably mistake as has already the same". (Not about differences in implementation/representation on compiler level, but on level of one who is writting the code)<br class=""><br class="">Should we use the same arguments to propose the special annotation when we have the same tuple more than once? No. So I believe there should be no such limitation and special annotation for proposed enums.<br class=""><br class=""></div></div></blockquote></div><br class=""><div class="">I am not sure the parallel can be made. A tuple is characterized by its structure, BUT the scope of its use is the VARIABLE where it is being used (I am simplifying by only referring to var/let cases). So from the compiler’s point of view, there is not a giant Tuples hash table where it can look for a given tuple definition based on its intrinsic name. So even if you repeat the same tuple definition every other line in your source code, the compiler never thinks that they are the same type because they ARE NOT the same. Each one is a different variable (the compiler would complain that the variable is defined multiple times though). To simplify the model, you could almost think that a tuple is a degenerate struct that is internally given the name of its usage site. It is not quite true but it is a close-enough approximation of what it really is.</div><div class=""><br class=""></div><div class="">The only rational for allowing a @I_know_what_I_am_doing_so_please_dont_complain annotation is to allow (and I am not saying it should be allowed)</div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><table class="tab-size highlight js-file-line-container" data-tab-size="8" style="box-sizing: border-box; border-spacing: 0px; border-collapse: collapse; tab-size: 8; color: rgb(51, 51, 51); font-family: Helvetica, arial, nimbussansl, liberationsans, freesans, clean, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol'; font-size: 13px;"><tbody class="" style="box-sizing: border-box;"><tr class="" style="box-sizing: border-box;"><td id="file-scalecrop-swift-LC6" class="js-file-line blob-code-inner blob-code" style="box-sizing: border-box; padding: 0px 10px; position: relative; vertical-align: top; overflow: visible; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 12px; word-wrap: normal; white-space: pre;"><span class="pl-k" style="box-sizing: border-box; color: rgb(167, 29, 93);">func</span> <span class="pl-en" style="box-sizing: border-box; color: rgb(121, 93, 163);">scaleAndCropLargeImage</span>(</td></tr><tr class="" style="box-sizing: border-box;"><td id="file-scalecrop-swift-L7" class="blob-num js-line-number" data-line-number="7" style="box-sizing: border-box; padding: 0px 10px; width: 50px; min-width: 50px; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 12px; line-height: 18px; text-align: right; white-space: nowrap; vertical-align: top; cursor: pointer; -webkit-user-select: none; border-style: solid; border-color: rgb(238, 238, 238); border-width: 0px 1px 0px 0px;"></td><td id="file-scalecrop-swift-LC7" class="js-file-line blob-code-inner blob-code" style="box-sizing: border-box; padding: 0px 10px; position: relative; vertical-align: top; overflow: visible; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 12px; word-wrap: normal; white-space: pre;"> image: UIImage,</td></tr><tr class="" style="box-sizing: border-box;"><td id="file-scalecrop-swift-L8" class="blob-num js-line-number" data-line-number="8" style="box-sizing: border-box; padding: 0px 10px; width: 50px; min-width: 50px; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 12px; line-height: 18px; text-align: right; white-space: nowrap; vertical-align: top; cursor: pointer; -webkit-user-select: none; border-style: solid; border-color: rgb(238, 238, 238); border-width: 0px 1px 0px 0px;"></td><td id="file-scalecrop-swift-LC8" class="js-file-line blob-code-inner blob-code" style="box-sizing: border-box; padding: 0px 10px; position: relative; vertical-align: top; overflow: visible; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 12px; word-wrap: normal; white-space: pre;"> <span class="pl-en" style="box-sizing: border-box; color: rgb(121, 93, 163);">toSize</span> <span class="pl-smi" style="box-sizing: border-box;">size</span>: CGSize,</td></tr><tr class="" style="box-sizing: border-box;"><td id="file-scalecrop-swift-L9" class="blob-num js-line-number" data-line-number="9" style="box-sizing: border-box; padding: 0px 10px; width: 50px; min-width: 50px; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 12px; line-height: 18px; text-align: right; white-space: nowrap; vertical-align: top; cursor: pointer; -webkit-user-select: none; border-style: solid; border-color: rgb(238, 238, 238); border-width: 0px 1px 0px 0px;"></td><td id="file-scalecrop-swift-LC9" class="js-file-line blob-code-inner blob-code" style="box-sizing: border-box; padding: 0px 10px; position: relative; vertical-align: top; overflow: visible; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 12px; word-wrap: normal; white-space: pre;"> <b class="">operation: <font color="#0086b3" class="">(.Fit | .Fill)</font> <span class="pl-k" style="box-sizing: border-box; color: rgb(167, 29, 93);">=</span> .<font color="#0086b3" class="">Fit</font></b></td></tr><tr class="" style="box-sizing: border-box;"><td id="file-scalecrop-swift-L10" class="blob-num js-line-number" data-line-number="10" style="box-sizing: border-box; padding: 0px 10px; width: 50px; min-width: 50px; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 12px; line-height: 18px; text-align: right; white-space: nowrap; vertical-align: top; cursor: pointer; -webkit-user-select: none; border-style: solid; border-color: rgb(238, 238, 238); border-width: 0px 1px 0px 0px;"></td><td id="file-scalecrop-swift-LC10" class="js-file-line blob-code-inner blob-code" style="box-sizing: border-box; padding: 0px 10px; position: relative; vertical-align: top; overflow: visible; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 12px; word-wrap: normal; white-space: pre;"> ) <span class="pl-k" style="box-sizing: border-box; color: rgb(167, 29, 93);">-></span> UIImage {
whoCaresThereIsReallyASingleTypeOfImagesAnyhow()
}
</td></tr></tbody></table><br class=""></div><div class=""><table class="tab-size highlight js-file-line-container" data-tab-size="8" style="box-sizing: border-box; border-spacing: 0px; border-collapse: collapse; tab-size: 8; color: rgb(51, 51, 51); font-family: Helvetica, arial, nimbussansl, liberationsans, freesans, clean, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol'; font-size: 13px;"><tbody class="" style="box-sizing: border-box;"><tr class="" style="box-sizing: border-box;"><td id="file-scalecrop-swift-LC6" class="js-file-line blob-code-inner blob-code" style="box-sizing: border-box; padding: 0px 10px; position: relative; vertical-align: top; overflow: visible; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 12px; word-wrap: normal; white-space: pre;"><span class="pl-k" style="box-sizing: border-box; color: rgb(167, 29, 93);">func</span> <span class="pl-en" style="box-sizing: border-box; color: rgb(121, 93, 163);">scaleAndCropSmallImage</span>(</td></tr><tr class="" style="box-sizing: border-box;"><td id="file-scalecrop-swift-L7" class="blob-num js-line-number" data-line-number="7" style="box-sizing: border-box; padding: 0px 10px; width: 50px; min-width: 50px; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 12px; line-height: 18px; text-align: right; white-space: nowrap; vertical-align: top; cursor: pointer; -webkit-user-select: none; border-style: solid; border-color: rgb(238, 238, 238); border-width: 0px 1px 0px 0px;"></td><td id="file-scalecrop-swift-LC7" class="js-file-line blob-code-inner blob-code" style="box-sizing: border-box; padding: 0px 10px; position: relative; vertical-align: top; overflow: visible; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 12px; word-wrap: normal; white-space: pre;"> image: UIImage,</td></tr><tr class="" style="box-sizing: border-box;"><td id="file-scalecrop-swift-L8" class="blob-num js-line-number" data-line-number="8" style="box-sizing: border-box; padding: 0px 10px; width: 50px; min-width: 50px; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 12px; line-height: 18px; text-align: right; white-space: nowrap; vertical-align: top; cursor: pointer; -webkit-user-select: none; border-style: solid; border-color: rgb(238, 238, 238); border-width: 0px 1px 0px 0px;"></td><td id="file-scalecrop-swift-LC8" class="js-file-line blob-code-inner blob-code" style="box-sizing: border-box; padding: 0px 10px; position: relative; vertical-align: top; overflow: visible; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 12px; word-wrap: normal; white-space: pre;"> <span class="pl-en" style="box-sizing: border-box; color: rgb(121, 93, 163);">toSize</span> <span class="pl-smi" style="box-sizing: border-box;">size</span>: CGSize,</td></tr><tr class="" style="box-sizing: border-box;"><td id="file-scalecrop-swift-L9" class="blob-num js-line-number" data-line-number="9" style="box-sizing: border-box; padding: 0px 10px; width: 50px; min-width: 50px; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 12px; line-height: 18px; text-align: right; white-space: nowrap; vertical-align: top; cursor: pointer; -webkit-user-select: none; border-style: solid; border-color: rgb(238, 238, 238); border-width: 0px 1px 0px 0px;"></td><td id="file-scalecrop-swift-LC9" class="js-file-line blob-code-inner blob-code" style="box-sizing: border-box; padding: 0px 10px; position: relative; vertical-align: top; overflow: visible; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 12px; word-wrap: normal; white-space: pre;"> <b class="">operation: <font color="#0086b3" class="">(.Fit | .Fill)</font> <span class="pl-k" style="box-sizing: border-box; color: rgb(167, 29, 93);">=</span> .<font color="#0086b3" class="">Fit</font></b></td></tr><tr class="" style="box-sizing: border-box;"><td id="file-scalecrop-swift-L10" class="blob-num js-line-number" data-line-number="10" style="box-sizing: border-box; padding: 0px 10px; width: 50px; min-width: 50px; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 12px; line-height: 18px; text-align: right; white-space: nowrap; vertical-align: top; cursor: pointer; -webkit-user-select: none; border-style: solid; border-color: rgb(238, 238, 238); border-width: 0px 1px 0px 0px;"></td><td id="file-scalecrop-swift-LC10" class="js-file-line blob-code-inner blob-code" style="box-sizing: border-box; padding: 0px 10px; position: relative; vertical-align: top; overflow: visible; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 12px; word-wrap: normal; white-space: pre;"> ) <span class="pl-k" style="box-sizing: border-box; color: rgb(167, 29, 93);">-></span> UIImage {
whoCaresThereIsReallyASingleTypeOfImagesAnyhow()
}
</td></tr></tbody></table><br class=""></div><div class=""><br class=""></div><div class="">private </div><table class="tab-size highlight js-file-line-container" data-tab-size="8" style="box-sizing: border-box; border-spacing: 0px; border-collapse: collapse; tab-size: 8; color: rgb(51, 51, 51); font-family: Helvetica, arial, nimbussansl, liberationsans, freesans, clean, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol'; font-size: 13px;"><tbody class="" style="box-sizing: border-box;"><tr class="" style="box-sizing: border-box;"><td id="file-scalecrop-swift-LC6" class="js-file-line blob-code-inner blob-code" style="box-sizing: border-box; padding: 0px 10px; position: relative; vertical-align: top; overflow: visible; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 12px; word-wrap: normal; white-space: pre;"><span class="pl-k" style="box-sizing: border-box; color: rgb(167, 29, 93);">func</span> whoCaresThereIsReallyASingleTypeOfImagesAnyhow(</td></tr><tr class="" style="box-sizing: border-box;"><td id="file-scalecrop-swift-L7" class="blob-num js-line-number" data-line-number="7" style="box-sizing: border-box; padding: 0px 10px; width: 50px; min-width: 50px; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 12px; line-height: 18px; text-align: right; white-space: nowrap; vertical-align: top; cursor: pointer; -webkit-user-select: none; border-style: solid; border-color: rgb(238, 238, 238); border-width: 0px 1px 0px 0px;"></td><td id="file-scalecrop-swift-LC7" class="js-file-line blob-code-inner blob-code" style="box-sizing: border-box; padding: 0px 10px; position: relative; vertical-align: top; overflow: visible; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 12px; word-wrap: normal; white-space: pre;"> image: UIImage,</td></tr><tr class="" style="box-sizing: border-box;"><td id="file-scalecrop-swift-L8" class="blob-num js-line-number" data-line-number="8" style="box-sizing: border-box; padding: 0px 10px; width: 50px; min-width: 50px; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 12px; line-height: 18px; text-align: right; white-space: nowrap; vertical-align: top; cursor: pointer; -webkit-user-select: none; border-style: solid; border-color: rgb(238, 238, 238); border-width: 0px 1px 0px 0px;"></td><td id="file-scalecrop-swift-LC8" class="js-file-line blob-code-inner blob-code" style="box-sizing: border-box; padding: 0px 10px; position: relative; vertical-align: top; overflow: visible; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 12px; word-wrap: normal; white-space: pre;"> <span class="pl-en" style="box-sizing: border-box; color: rgb(121, 93, 163);">toSize</span> <span class="pl-smi" style="box-sizing: border-box;">size</span>: CGSize,</td></tr><tr class="" style="box-sizing: border-box;"><td id="file-scalecrop-swift-L9" class="blob-num js-line-number" data-line-number="9" style="box-sizing: border-box; padding: 0px 10px; width: 50px; min-width: 50px; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 12px; line-height: 18px; text-align: right; white-space: nowrap; vertical-align: top; cursor: pointer; -webkit-user-select: none; border-style: solid; border-color: rgb(238, 238, 238); border-width: 0px 1px 0px 0px;"></td><td id="file-scalecrop-swift-LC9" class="js-file-line blob-code-inner blob-code" style="box-sizing: border-box; padding: 0px 10px; position: relative; vertical-align: top; overflow: visible; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 12px; word-wrap: normal; white-space: pre;"> <b class="">operation: <font color="#0086b3" class="">(.Fit | .Fill)</font> <span class="pl-k" style="box-sizing: border-box; color: rgb(167, 29, 93);">=</span> .<font color="#0086b3" class="">Fit</font></b></td></tr><tr class="" style="box-sizing: border-box;"><td id="file-scalecrop-swift-L10" class="blob-num js-line-number" data-line-number="10" style="box-sizing: border-box; padding: 0px 10px; width: 50px; min-width: 50px; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 12px; line-height: 18px; text-align: right; white-space: nowrap; vertical-align: top; cursor: pointer; -webkit-user-select: none; border-style: solid; border-color: rgb(238, 238, 238); border-width: 0px 1px 0px 0px;"></td><td id="file-scalecrop-swift-LC10" class="js-file-line blob-code-inner blob-code" style="box-sizing: border-box; padding: 0px 10px; position: relative; vertical-align: top; overflow: visible; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 12px; word-wrap: normal; white-space: pre;"> ) <span class="pl-k" style="box-sizing: border-box; color: rgb(167, 29, 93);">-></span> UIImage {
</td></tr></tbody></table></div>_______________________________________________<br class="">swift-evolution mailing list<br class=""><a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a><br class=""><a href="https://lists.swift.org/mailman/listinfo/swift-evolution" class="">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br class=""></div></blockquote></div><br class=""></div></div></blockquote></div><br class=""></div></div></blockquote></div><br class=""></div></div></blockquote></div></body></html>