September 11 Learn » Re: Is it possible to use templates to implement something like the `@show` macro from the Julia programming langauge in D? | |||
|---|---|---|---|
| |||
```d
assert(echo2("T $i, b, ${i-2}") == "writefln(\"T \", i, \", b, \", (i-2));\n... | |||
September 11 Learn » Re: Is it possible to use templates to implement something like the `@show` macro from the Julia programming langauge in D? | |||
|---|---|---|---|
| |||
Yes. https://github.com/baryluk/echo/blob/master/echo.d#L205-L209 ```d mixin(echo... | |||
September 09 Learn » Re: Is it possible to use templates to implement something like the `@show` macro from the Julia programming langauge in D? | |||
|---|---|---|---|
| |||
After all, you will need it in 2 ways: 1. to learn, 2. to test... | |||
September 09 Learn » Re: Is it possible to use templates to implement something like the `@show` macro from the Julia programming langauge in D? | |||
|---|---|---|---|
| |||
I made it on dlang.io which does space tabs, if its not ovisous to... | |||
September 09 Learn » Re: Is it possible to use templates to implement something like the `@show` macro from the Julia programming langauge in D? | |||
|---|---|---|---|
| |||
I tested this version on my machine and the output isn't correct. It gets... | |||
September 09 Learn » Re: Is it possible to use templates to implement something like the `@show` macro from the Julia programming langauge in D? | |||
|---|---|---|---|
| |||
i isn't being modified by a `*=`. its only the two ++ | |||
September 09 Learn » Re: Is it possible to use templates to implement something like the `@show` macro from the Julia programming langauge in D? | |||
|---|---|---|---|
| |||
This solution is really successful. I didn't think there could be any other solution... | |||
September 09 Learn » Re: Is it possible to use templates to implement something like the `@show` macro from the Julia programming langauge in D? | |||
|---|---|---|---|
| |||
import std; auto parse(char[] s)=>s[9..$-2]; void show(T,string file= __FILE... | |||
September 09 Learn » Re: Is it possible to use templates to implement something like the `@show` macro from the Julia programming langauge in D? | |||
|---|---|---|---|
| |||
Thank you all for your very helpful replies and for taking the time to make... | |||
September 09 Learn » Re: Is it possible to use templates to implement something like the `@show` macro from the Julia programming langauge in D? | |||
|---|---|---|---|
| |||
Try this:
```
import core.interpolation;
void show(Args...)(InterpolationHeader hdr, Args args, InterpolationFooter ftr) {
import... | |||
Copyright © 1999-2021 by the D Language Foundation