Discussion Thread: DIP 1036--Formatted String Tuple Literals--Community Review Round 1

Paul Backus snarwin at gmail.com
Fri Sep 11 13:46:52 UTC 2020


On Friday, 11 September 2020 at 13:19:37 UTC, 12345swordy wrote:
> On Thursday, 10 September 2020 at 20:50:24 UTC, Paul Backus 
> wrote:
>
>> This won't stop people from calling functions with the wrong 
>> arguments, but I don't think it needs to--that should be each 
>> function's responsibility, not the language's (see: Scott 
>> Meyers' Year/Month/Day example).
>
> That issue that I have with your stance, is that we are dealing 
> with c/c++ bindings here. How is c/c++ responsible in this 
> case? You are asking the binder maintainer to create a wrapper 
> to prevent accident function call.

Yes, that's exactly what I'm asking. Note that this is something 
D *already* does when it provides wrappers like `writefln` as 
alternatives to C functions like `printf`, so in practice, it 
should not require any new work to be done.

Keep in mind that any argument list you could generate using my 
or DIP 1027's interpolated strings is also an argument list you 
could have written by hand. So if a function is error-prone to 
call with string interpolation, chances are it's also error-prone 
to call without it.


More information about the Digitalmars-d mailing list