yet another string interp dip, simple edition

monkyyy crazymonkyyy at gmail.com
Mon Jan 15 00:40:15 UTC 2024


On Monday, 15 January 2024 at 00:11:13 UTC, Alexandru Ermicioi 
wrote:
> 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?

sounds like an awful lot of sql's problem, and what do you want 
the compiler to throw an exception?

what if someone else wants a string that doesn't throw an 
exception based on some software that they may not even be aware 
of?


More information about the Digitalmars-d mailing list