<div dir="ltr"><div dir="ltr">On Mon, Nov 2, 2020 at 4:30 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 Monday, 2 November 2020 at 03:49:41 UTC, Manu wrote:<br>
> On Mon, Nov 2, 2020 at 8:15 AM Ola Fosheim Grøstad via <br>
> Digitalmars-d < <a href="mailto:digitalmars-d@puremagic.com" target="_blank">digitalmars-d@puremagic.com</a>> wrote:<br>
>> Well, it is a good thing if they behave as immutable structs <br>
>> as you then can get a more uniform language.<br>
><br>
> I think it is conceptually improper for a tuple to have a <br>
> memory layout; especially considering tuples can hold elements <br>
> that are types or aliases in addition to typed values.<br>
<br>
D should reduce the number of types you have to account for in <br>
generic code.<br></blockquote><div><br></div><div>I'm not sure what this means.</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">
> It's also extremely complicated to know what the output of <br>
> `...` applied to<br>
> an array-like thing should be? Is it a tuple? If you apply <br>
> `...` to an<br>
> array or a range, and it becomes a tuple, that is probably <br>
> going to reveal<br>
> serious semantic problems.<br>
<br>
It should not be a tuple, it should be an extension of a comma <br>
list. Think splat operator.</blockquote><div><br></div><div>My DIP is not like that.</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">
The compiler only needs to know the length of the sequence in <br>
order to expand.<br>
<br>
>   fun(constantRange); // <-- function receives range as argument<br>
>   fun(expr(constantRange)...); // <-- the function call fails<br>
<br>
I dont understand this example.<br></blockquote><div><br></div><div>The type is lost, so by applying a map expression to an array-like-thing, you can't use it in its original context anymore.</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">
><br>
> Or this:<br>
>   immutable int[] allTheThings = [ ... ];<br>
>   alias Selection = AliasSeq!(5, 1, 15);<br>
>   alias res = allTheThings[Selection]...; // <-- we have an <br>
> array, and a<br>
> tuple both participating in the map; if `...` applied to <br>
> array-like-things,<br>
> then this extremely important pattern would be impossible<br>
<br>
I suggested explicit indexing, so not a problem.<br></blockquote><div><br></div><div>I don't understand this comment.<br></div></div></div>