On Sunday, 24 October 2021 at 14:05:35 UTC, Simon wrote:
On Saturday, 23 October 2021 at 20:24:32 UTC, Tim wrote:
[...]
That worked! I needed to modify it a bit, since there is the
"execution_count_to_log_reproduction_on"-template parameterto
the enum. If I try to use that inside the token s
On Saturday, 23 October 2021 at 20:24:32 UTC, Tim wrote:
import std.traits, std.stdio;
string generateLogCode(alias func)()
{
string code = "writeln(";
code ~= "\"" ~ fullyQualifiedName!func ~ "(\"";
foreach(i, param; ParameterIdentifierTuple!func)
{
if(i)
code
On Saturday, 23 October 2021 at 19:52:19 UTC, Simon wrote:
Thanks for putting up with me! I tried a bunch and it seems
like I left out too much code, because I can't get it working
100%. I didn't even know about the q{} syntax, so I didn't
think the stuff I left out would matter, but when usi
On Saturday, 23 October 2021 at 18:23:47 UTC, Simon wrote:
For debugging purposes, I have built a mixin that will, when
declared inside a function, output code to the console that
will reproduce the exact function call.
Sounds like what you really want is
https://github.com/dlang/dmd/pull/130
On Saturday, 23 October 2021 at 19:03:41 UTC, Tim wrote:
On Saturday, 23 October 2021 at 18:56:48 UTC, Simon wrote:
And I tried to use your suggestion like this:
enum OUTPUT_REPRO_CASE(alias func = __traits(parent, {})) =
"build the actual code stuff with"~fullyQualifiedName!func~"
and so on"
On Saturday, 23 October 2021 at 18:56:48 UTC, Simon wrote:
And I tried to use your suggestion like this:
enum OUTPUT_REPRO_CASE(alias func = __traits(parent, {})) =
"build the actual code stuff with"~fullyQualifiedName!func~"
and so on";
Which doesn't work. In that case func seems to become
On Saturday, 23 October 2021 at 18:36:27 UTC, Tim wrote:
On Saturday, 23 October 2021 at 18:23:47 UTC, Simon wrote:
So what I am looking for then is the equivalent to
__FUNCTION__ that evaluates to the actual symbol of the
function instead of its name, so it can be used as a parameter
to Param
On Saturday, 23 October 2021 at 18:23:47 UTC, Simon wrote:
So what I am looking for then is the equivalent to __FUNCTION__
that evaluates to the actual symbol of the function instead of
its name, so it can be used as a parameter to
ParameterIdentifierTuple.
You could use the following:
alias
For debugging purposes, I have built a mixin that will, when
declared inside a function, output code to the console that will
reproduce the exact function call.
So, as an example, for the following function
int reproducible_function(int a, int b){
mixin(OUTPUT_REPRO_CASE!reproducible_functio