Discussion Thread: DIP 1036--String Interpolation Tuple Literals--Community Review Round 2

Rikki Cattermole alphaglosined at gmail.com
Fri Jan 29 09:15:36 UTC 2021


On Friday, 29 January 2021 at 08:57:13 UTC, Walter Bright wrote:
> On 1/29/2021 12:46 AM, rikki cattermole wrote:
>> I agree, we shouldn't need to write the mapper function which 
>> Steven wrote ourselves.
>> 
>> We (Steven and I) discussed this on Discord and left it at the 
>> function should not be included in the DIP. From a UX POV, it 
>> should be just a matter of doing an alias IMO. But that isn't 
>> really a goal of a DIP to specify such utility.
>
> Even if it becomes part of Phobos, overloading C functions 
> imported from external C libraries in general makes me 
> uncomfortable, because it hides the fact that the C function 
> isn't being called. I never liked C macros like:
>
>     #define printf(...) printf("abc" ...)
>
> for the same reason.

Would a pragma i.e.

pragma(rewriteStringIntoFormatVarargs)
extern(C) int printf(const char* fmt, ...);

Make you feel more comfortable with this DIP?

This way only functions which the binding creator says fall into 
this style can be called via a interpolated string correctly. 
Without any overloads or anything else.


More information about the Digitalmars-d mailing list