On Monday, 9 April 2018 at 13:03:38 UTC, Simen Kjærås wrote:
On Monday, 9 April 2018 at 11:33:56 UTC, Alex wrote:
On Monday, 9 April 2018 at 09:20:42 UTC, Simen Kjærås wrote:
Nope. Something along the lines of __traits(getSource, arg)
has been discussed occasionally.
Is this available
On Monday, 9 April 2018 at 08:27:50 UTC, Per Nordlöw wrote:
Is it possible to get the source expression sent to a lazy
function?
So that I can implement something like
show(Arg)(lazy Arg arg)
{
writeln(arg.sourceof, arg);
}
used as
show(1+2+3);
will print
1+2+3:6
Because of
On Monday, 9 April 2018 at 11:33:56 UTC, Alex wrote:
On Monday, 9 April 2018 at 09:20:42 UTC, Simen Kjærås wrote:
Nope. Something along the lines of __traits(getSource, arg)
has been discussed occasionally.
Is this available somehow? And/or do you have a link to the
discussion, maybe?
On Monday, 9 April 2018 at 09:20:42 UTC, Simen Kjærås wrote:
Nope. Something along the lines of __traits(getSource, arg) has
been discussed occasionally.
Is this available somehow? And/or do you have a link to the
discussion, maybe?
On Monday, 9 April 2018 at 08:27:50 UTC, Per Nordlöw wrote:
Is it possible to get the source expression sent to a lazy
function?
Nope. Something along the lines of __traits(getSource, arg) has
been discussed occasionally.
For lazy what you're asking is impossible, since the compiler
On Monday, April 09, 2018 08:27:50 Per Nordlöw via Digitalmars-d-learn
wrote:
> Is it possible to get the source expression sent to a lazy
> function?
>
> So that I can implement something like
>
> show(Arg)(lazy Arg arg)
> {
> writeln(arg.sourceof, arg);
> }
>
> used as
>
>
On Monday, 9 April 2018 at 08:27:50 UTC, Per Nordlöw wrote:
Is it possible to get the source expression sent to a lazy
function?
So that I can implement something like
show(Arg)(lazy Arg arg)
{
writeln(arg.sourceof, arg);
}
used as
show(1+2+3);
will print
1+2+3:6
No (afaik),
Is it possible to get the source expression sent to a lazy
function?
So that I can implement something like
show(Arg)(lazy Arg arg)
{
writeln(arg.sourceof, arg);
}
used as
show(1+2+3);
will print
1+2+3:6