jai-like CTFE string formating

ixid via Digitalmars-d digitalmars-d at puremagic.com
Sat Aug 12 06:19:12 PDT 2017


On Saturday, 12 August 2017 at 11:47:10 UTC, Stefan Koch wrote:
> Whereas the following alternative takes 20 ms :
> {
>     import ctfe_utils;
>     pragma(msg, format_jai("Hello % % % % % % % % %", " I ", " 
> just", " have" , " to", " concat", " a lot", " of", " strings 
> ...", 9));
> }
>
> see for yourself:
> https://www.youtube.com/watch?v=T0BJxdt61RY

Could we not improve the syntax to something like:

      pragma(msg, format_jai("Hello %9", " I ", "
  just", " have" , " to", " concat", " a lot", " of", " strings
  ..."));
  }

Or whatever is closest that doesn't step on the current print 
syntax.


More information about the Digitalmars-d mailing list