tuple(...).each error; why does foreach work and std.algorithms.each doesn't ?

wjoe invalid at example.com
Tue Feb 11 19:51:47 UTC 2020


On Tuesday, 11 February 2020 at 19:05:19 UTC, Adam D. Ruppe wrote:
> On Tuesday, 11 February 2020 at 18:55:45 UTC, wjoe wrote:
>> What's a compiler list... is that something like a tuple?
>
> Yea, they are frequently called tuples too. It is basically 
> just a list of arguments used for a function call that the 
> compiler treats somewat magically.
>
>> Is it possible to partially expand like:
>>
>> void fn(int, uint) {}
>> and ARGS(string, int, uint)
>> and call fn(args[1..$]);
>
> Yes, slicing is the exact syntax for it. You can slice and 
> index as if it were an array.

Cool. thanks for your reply :)


More information about the Digitalmars-d-learn mailing list