May 15

I dont know what progress there been on named arguments, but... it seems like its been a while

As a bandaid, just vomit some sort of ugly details at me in a trait

import std;
void foo(T...)(T args,bool magic=true){
	args.writeln;
        magic.writeln;
}
unittest{
	foo(1,2,3);
	foo(1,2,magic:false);
}

I know of no way to make even this simple code work

so, __traits(namesofvarargs,T)==["","","magic"]; give me one piece of data and I can figure it out and make some better apis until full named tuples come.

May 16

On Thursday, 15 May 2025 at 22:08:45 UTC, monkyyy wrote:

>
import std;
void foo(T...)(T args,bool magic=true){
	args.writeln;
        magic.writeln;
}
unittest{
	foo(1,2,3);
	foo(1,2,magic:false);
}

I know of no way to make even this simple code work

The only way I know is to provide the type sequence for T:

    alias Seq(S...) = S;
    foo!(Seq!(int, int))(1, 2, magic:false);
>

so, __traits(namesofvarargs,T)==["","","magic"]; give me one piece of data and I can figure it out and make some better apis until full named tuples come.

T doesn't know anything about magic, it's just a type sequence. Also, args is not a variadic parameter.