Is it possible to use tokens as template parameters?

rempas rempas at tutanota.com
Sun Aug 15 05:47:34 UTC 2021


On Saturday, 14 August 2021 at 20:35:18 UTC, jfondren wrote:
> On Saturday, 14 August 2021 at 11:23:12 UTC, rempas wrote:
>> [...]
>
> When I was learning Rust I kept running into syntaxes like this 
> in books and examples. The funny thing was that the latest 
> versions of the libraries had all gotten rid of these macros. 
> To be able to put something like `mime!(text/html)` in your 
> code seemed cool, using Rust's token-based macros, but then it 
> was more trouble than it was worth and the fad ended with 
> prejudice.
>
> [...]

Makes sense. I also thought that Rust's macro_rules! were cool 
but I understand your point. Thanks a lot!


More information about the Digitalmars-d mailing list