Discussion Thread: DIP 1036--String Interpolation Tuple Literals--Community Review Round 2
Daniel N
no at public.email
Wed Feb 3 22:07:47 UTC 2021
On Wednesday, 3 February 2021 at 20:12:24 UTC, Adam D. Ruppe
wrote:
> On Wednesday, 3 February 2021 at 20:02:57 UTC, Daniel N wrote:
>> Wouldn't this lowering be both simpler and more more efficient?
>
> Your change wouldn't expose the string for compile time
> processing.
>
> That's the real benefit of interp!"string" - it is available
> for CTFE rewriting by the function.
Guess it's not allowed to keep discussing in the feedback thread
so I have to copy it here.
alias I(T...) = T;
alias X(T...) = I!(interp!(T[0]), interp!(T[1]));
Sorry for being daft, I simply don't get it... there's no issue
with applying map to a tuple of string literals...
X!("one","two")
Maybe you have to jump through some extra hoops, but in the
common case, is more optimized if there are no superfluous
template instances for every little string...
/Daniel
More information about the Digitalmars-d
mailing list