<div dir="ltr"><div dir="ltr">On Wed, Oct 28, 2020 at 11:35 PM Ola Fosheim Grøstad via Digitalmars-d <<a href="mailto:digitalmars-d@puremagic.com">digitalmars-d@puremagic.com</a>> wrote:<br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On Tuesday, 27 October 2020 at 10:54:07 UTC, Mike Parker wrote:<br>
> This is the discussion thread for the first round of Community <br>
> Review of DIP 1037, "Add Unary Operator ...":<br>
<br>
I think it should be made more generic and flexible. Make it work <br>
with all sequence types that provides a length and indexing. </blockquote><div><br></div><div>Definitely not my DIP. I can immediately imagine heaps of issues with that idea, and I have never wanted that before.</div><div></div><div>If you want to do a non-static map, then use `map`, which accepts a lambda and looks and feels very natural and convenient.</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Make it possible to offset.</blockquote><div><br></div><div>Not sure what this means? You can slice tuples in D, does that not give you the ability to offset as you like?</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"> Make it work for empty sequences (initial <br>
value for fold/reduce).</blockquote><div><br></div><div>I don't think this is necessary, and it is deliberately omitted. You can append a limit value to a tuple trivially using something like AliasSeq!(limit, MyTup).</div><div>Perhaps in the future if we ever get first-class tuples, you can use `~` to intuitively concatenate tuples, and I think that's more proper than what C++ does. If it turns out I'm wrong and it should exist, then it's a trivial expansion.</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Make the comma-expansion more intuitive. <br>
E.g. (pseduo):<br>
<br>
Given:<br>
<br>
seq1 = /* 1 ,2, 3 */<br>
seq2 = /* 10, 20, 30, 40, 50*/<br>
<br>
<br>
IN:<br>
(seq1[_]*10 + seq2[_+1], ...)<br>
<br>
OUT (e.g. length = min(seq1.length, seq2.length):<br>
(seq1[0]*10 + seq2[1], seq1[1]*10 + seq2[2], seq1[2]*10 + seq2[3])</blockquote><div><br></div><div></div><div>That looks like a minefield of grammatical issues. Why would you prefer that with the comma separating the expression and `...`?</div></div></div>