Is it possible to use templates to implement something like the `@show` macro from the Julia programming langauge in D?
monkyyy
crazymonkyyy at gmail.com
Mon Sep 9 02:09:05 UTC 2024
On Monday, 9 September 2024 at 00:34:03 UTC, Paul Backus wrote:
>
> The only way
is that a challenge?
> void main()
> {
> import std.stdio;
>
> mixin(show!"1 + 2"); // 1 + 2 == 3
>
> const int x = 1 + 2;
> mixin(show!"x"); // x == 3
> }
> ```
idk why you calling it a macro, im pretty sure d isnt going to
make it easy to climb up the ast ever, and op wants sometin that
reads statement literals.
More information about the Digitalmars-d-learn
mailing list