yet another string interp dip, simple edition

monkyyy crazymonkyyy at gmail.com
Sun Jan 14 23:20:36 UTC 2024


`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


More information about the Digitalmars-d mailing list