yet another string interp dip, simple edition

Alexandru Ermicioi alexandru.ermicioi at gmail.com
Mon Jan 15 00:11:13 UTC 2024


On Sunday, 14 January 2024 at 23:20:36 UTC, monkyyy wrote:
> `i"$foo $bar"` makes a string literal at the call site, no one 
> gets to format anything, make templates, or anything else; no 
> change to templates syntax for to match some strange usecase 
> that no one remembers anymore.
>
> `i"$$"=='$'` double $ is the excape, so theres only one control 
> char that changes
>
> `float f=1.337; assert(i"$f"=="1.34");` floats are round two 
> digits, always
>
> `Vector2 v; assert(i"$v"==v.toString);` structs reuse the 
> toString norms
>
> `int array=[1,2,3]; assert(mixin(i"$array")==array);` base 
> types and combinations of base types, create sane mixins

what about security issues such as sql injection?


More information about the Digitalmars-d mailing list