vibe.d diet - is there a way to use a D variable inside the "parameters" of a tag

Chris Bare chris at bareflix.com
Tue Dec 29 20:22:24 UTC 2020


On Tuesday, 29 December 2020 at 20:16:40 UTC, Chris Bare wrote:
> I'm trying to generate a list of buttons and insert the value 
> programmatically.
> Here's what I've tried:
> 		- foreach (i; ["Prev", "Replay", "Next"])
> 			input(type="button",value=#{i})
> that does not compile.
> if instead I use:
> 			input(#{i})
> It compiles, but generates: <input #{i}>
>
> Is there a way to double escape the variable, or is 
> substitution just not supported there?

One minute after I sent this I tried:
input(type="button",value=i)

and that works.


More information about the Digitalmars-d mailing list