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... | |||
September 09 Learn » Re: Is it possible to use templates to implement something like the `@show` macro from the Julia programming langauge in D? | |||
|---|---|---|---|
| |||
is that a challenge? idk why you calling it a macro, im pretty sure d... | |||
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 works for `show!"1+2"`, but it won't work for `show!"x"`, because... | |||
September 09 Learn » Re: Is it possible to use templates to implement something like the `@show` macro from the Julia programming langauge in D? | |||
|---|---|---|---|
| |||
The only way to write a macro in D that executes code in the scope... | |||
Copyright © 1999-2021 by the D Language Foundation