<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 7 May 2017, at 10:30, Xiaodi Wu <<a href="mailto:xiaodi.wu@gmail.com" class="">xiaodi.wu@gmail.com</a>> wrote:</div><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; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><div class="gmail_extra"><div class="gmail_quote"><br class=""><div class="">Sorry, I'm confused: what is the point of adding a method that does the same thing as an existing free function? With one-sided ranges now a part of the language, I'd support removal of `enumerated()` with no other changes.</div></div></div></div></div></blockquote></div><br class=""><div class="">I’m talking about scenario where you have a chain of sequence operations, say:</div><div class=""><br class=""></div><div class=""><div style="margin: 0px; line-height: normal; font-family: 'DejaVu Sans Mono'; color: rgb(50, 137, 213);" class=""><div style="margin: 0px; line-height: normal; color: rgb(100, 122, 131);" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">(</span><span style="font-variant-ligatures: no-common-ligatures; color: #d73f82" class="">1</span><span style="font-variant-ligatures: no-common-ligatures" class="">...N).</span><span style="font-variant-ligatures: no-common-ligatures; color: #3289d5" class="">makeIterator</span><span style="font-variant-ligatures: no-common-ligatures" class="">().</span><span style="font-variant-ligatures: no-common-ligatures; color: #3289d5" class="">enumerated</span><span style="font-variant-ligatures: no-common-ligatures" class="">().</span><span style="font-variant-ligatures: no-common-ligatures; color: #3289d5" class="">lazy</span><span style="font-variant-ligatures: no-common-ligatures" class="">.</span><span style="font-variant-ligatures: no-common-ligatures; color: #3289d5" class="">prefix</span><span style="font-variant-ligatures: no-common-ligatures" class="">(while: {$0.</span><span style="font-variant-ligatures: no-common-ligatures; color: #d73f82" class="">0</span><span style="font-variant-ligatures: no-common-ligatures" class=""> < oneLess}).</span><span style="font-variant-ligatures: no-common-ligatures; color: #3289d5" class="">count</span><span style="font-variant-ligatures: no-common-ligatures" class="">()</span></div></div></div><div style="margin: 0px; line-height: normal; font-family: 'DejaVu Sans Mono'; color: rgb(50, 137, 213);" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #647a83" class=""><br class=""></span></div><div style="margin: 0px; line-height: normal; font-family: 'DejaVu Sans Mono'; color: rgb(50, 137, 213);" class=""><span style="color: rgb(0, 0, 0); font-family: Helvetica;" class="">With a free function, you need to break the chain in order to replace enumerated with zip:</span></div><div style="margin: 0px; line-height: normal; font-family: 'DejaVu Sans Mono'; color: rgb(50, 137, 213);" class=""><span style="color: rgb(0, 0, 0); font-family: Helvetica;" class=""><br class=""></span></div><div style="margin: 0px; line-height: normal; font-family: 'DejaVu Sans Mono'; color: rgb(50, 137, 213);" class=""><div style="margin: 0px; line-height: normal; color: rgb(100, 122, 131);" class=""><div style="margin: 0px; line-height: normal;" class=""><div style="margin: 0px; line-height: normal;" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #3289d5" class="">zip</span><span style="font-variant-ligatures: no-common-ligatures" class="">((</span><span style="font-variant-ligatures: no-common-ligatures; color: #d73f82" class="">1</span><span style="font-variant-ligatures: no-common-ligatures" class="">...N).</span><span style="font-variant-ligatures: no-common-ligatures; color: #3289d5" class="">makeIterator</span><span style="font-variant-ligatures: no-common-ligatures" class="">(), </span><span style="font-variant-ligatures: no-common-ligatures; color: #d73f82" class="">0</span><span style="font-variant-ligatures: no-common-ligatures" class="">...oneLess).</span><span style="font-variant-ligatures: no-common-ligatures; color: #3289d5" class="">lazy</span><span style="font-variant-ligatures: no-common-ligatures" class="">.</span><span style="font-variant-ligatures: no-common-ligatures; color: #3289d5" class="">prefix</span><span style="font-variant-ligatures: no-common-ligatures" class="">(while: {$0.</span><span style="font-variant-ligatures: no-common-ligatures; color: #d73f82" class="">0</span><span style="font-variant-ligatures: no-common-ligatures" class=""> < oneLess}).</span><span style="font-variant-ligatures: no-common-ligatures; color: #3289d5" class="">count</span><span style="font-variant-ligatures: no-common-ligatures" class="">()</span></div></div></div></div><div style="margin: 0px; line-height: normal; font-family: 'DejaVu Sans Mono'; color: rgb(50, 137, 213);" class=""><span style="color: rgb(0, 0, 0); font-family: Helvetica;" class=""><br class=""></span></div><div style="margin: 0px; line-height: normal; font-family: 'DejaVu Sans Mono'; color: rgb(50, 137, 213);" class=""><span style="color: rgb(0, 0, 0); font-family: Helvetica;" class="">It forces you to rearrange your code into less than ideal order. Free function zip works great if you start with it. Not when you need to employ it in the middle of the chain. </span></div><div style="margin: 0px; line-height: normal; font-family: 'DejaVu Sans Mono'; color: rgb(50, 137, 213);" class=""><span style="color: rgb(0, 0, 0); font-family: Helvetica;" class=""><br class=""></span></div><div style="margin: 0px; line-height: normal; font-family: 'DejaVu Sans Mono'; color: rgb(50, 137, 213);" class=""><div style="margin: 0px; line-height: normal; color: rgb(100, 122, 131);" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">(</span><span style="font-variant-ligatures: no-common-ligatures; color: #d73f82" class="">1</span><span style="font-variant-ligatures: no-common-ligatures" class="">...N).</span><span style="font-variant-ligatures: no-common-ligatures; color: #3289d5" class="">makeIterator</span><span style="font-variant-ligatures: no-common-ligatures" class="">().</span><span style="font-variant-ligatures: no-common-ligatures; color: #3289d5" class="">zipped</span><span style="font-variant-ligatures: no-common-ligatures" class="">(with: </span><span style="font-variant-ligatures: no-common-ligatures; color: #d73f82" class="">0</span><span style="font-variant-ligatures: no-common-ligatures" class="">...oneLess).</span><span style="font-variant-ligatures: no-common-ligatures; color: #3289d5" class="">lazy</span><span style="font-variant-ligatures: no-common-ligatures" class="">.</span><span style="font-variant-ligatures: no-common-ligatures; color: #3289d5" class="">prefix</span><span style="font-variant-ligatures: no-common-ligatures" class="">(while: {$0.</span><span style="font-variant-ligatures: no-common-ligatures; color: #d73f82" class="">0</span><span style="font-variant-ligatures: no-common-ligatures" class=""> < oneLess}).</span><span style="font-variant-ligatures: no-common-ligatures; color: #3289d5" class="">count</span><span style="font-variant-ligatures: no-common-ligatures" class="">()</span></div></div><div style="margin: 0px; line-height: normal; font-family: 'DejaVu Sans Mono'; color: rgb(50, 137, 213);" class=""><span style="color: rgb(0, 0, 0); font-family: Helvetica;" class=""><br class=""></span></div><div style="margin: 0px; line-height: normal;" class="">Just to be clear, how much change I’m proposing here, in case we remove enumerated:</div><div style="margin: 0px; line-height: normal;" class=""><br class=""></div><div style="margin: 0px; line-height: normal;" class=""><div style="margin: 0px; line-height: normal; font-family: 'DejaVu Sans Mono'; color: rgb(215, 63, 130);" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">extension</span><span style="font-variant-ligatures: no-common-ligatures; color: #647a83" class=""> </span><span style="font-variant-ligatures: no-common-ligatures; color: #ce4d28" class="">Sequence</span><span style="font-variant-ligatures: no-common-ligatures; color: #647a83" class=""> {</span></div><div style="margin: 0px; line-height: normal; font-family: 'DejaVu Sans Mono'; color: rgb(100, 122, 131);" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> </span><span style="font-variant-ligatures: no-common-ligatures; color: #d73f82" class="">func</span><span style="font-variant-ligatures: no-common-ligatures" class=""> zipped<S>(with otherSequence: </span><span style="font-variant-ligatures: no-common-ligatures; color: #ce4d28" class="">S</span><span style="font-variant-ligatures: no-common-ligatures" class="">) -> </span><span style="font-variant-ligatures: no-common-ligatures; color: #ce4d28" class="">Zip2Sequence</span><span style="font-variant-ligatures: no-common-ligatures" class=""><</span><span style="font-variant-ligatures: no-common-ligatures; color: #ce4d28" class="">Self</span><span style="font-variant-ligatures: no-common-ligatures" class="">, </span><span style="font-variant-ligatures: no-common-ligatures; color: #ce4d28" class="">S</span><span style="font-variant-ligatures: no-common-ligatures" class="">> </span><span style="font-variant-ligatures: no-common-ligatures; color: #d73f82" class="">where</span><span style="font-variant-ligatures: no-common-ligatures" class=""> </span><span style="font-variant-ligatures: no-common-ligatures; color: #ce4d28" class="">S</span><span style="font-variant-ligatures: no-common-ligatures" class="">: </span><span style="font-variant-ligatures: no-common-ligatures; color: #ce4d28" class="">Sequence</span><span style="font-variant-ligatures: no-common-ligatures" class=""> {</span></div><div style="margin: 0px; line-height: normal; font-family: 'DejaVu Sans Mono'; color: rgb(100, 122, 131);" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> </span><span style="font-variant-ligatures: no-common-ligatures; color: #d73f82" class="">return</span><span style="font-variant-ligatures: no-common-ligatures" class=""> </span><span style="font-variant-ligatures: no-common-ligatures; color: #3289d5" class="">zip</span><span style="font-variant-ligatures: no-common-ligatures" class=""> (</span><span style="font-variant-ligatures: no-common-ligatures; color: #d73f82" class="">self</span><span style="font-variant-ligatures: no-common-ligatures" class="">, otherSequence)</span></div><div style="margin: 0px; line-height: normal; font-family: 'DejaVu Sans Mono'; color: rgb(100, 122, 131);" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> }</span></div><div style="margin: 0px; line-height: normal; font-family: 'DejaVu Sans Mono'; color: rgb(100, 122, 131);" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">}</span></div></div><div style="margin: 0px; line-height: normal;" class=""><br class=""></div><div style="margin: 0px; line-height: normal;" class=""><div style="margin: 0px; line-height: normal;" class="">Best regards</div><div style="margin: 0px; line-height: normal;" class="">Pavol Vaskovic </div></div></body></html>