DIP1027 + Design by Introspection

Daniel N no at public.email
Tue Feb 2 17:29:53 UTC 2021


On Tuesday, 2 February 2021 at 16:57:36 UTC, Adam D. Ruppe wrote:
>> Key insight, the function specifies what format it expects.
>> printf(...)   @formatting!printf_style
>> writefln(...) @formatting!writefln_style
>
> DIP 1036 can do this as it is already written! You don't need a 
> magic UDA, you just overload the function on the interp type as 
> a library author.
>
> Or you can simply call a function inside the interpolation 
> thing if you want to do custom stuff as a user.

In my opinion the user-facing interface of my proposal is cleaner 
as you don't have to introduce an interp template, you won't have 
to overload anything nor wrap anything.



More information about the Digitalmars-d mailing list