DIP 1019--Named Arguments Lite--Community Review Round 1

Francesco Mecca me at francescomecca.eu
Sat Feb 16 10:02:02 UTC 2019


On Friday, 15 February 2019 at 17:43:52 UTC, 12345swordy wrote:
> On Friday, 15 February 2019 at 17:38:23 UTC, Francesco Mecca 
> wrote:
>> On Friday, 15 February 2019 at 13:49:04 UTC, Atila Neves wrote:
>>> [...]
>>
>> I think that the solution proposed by Atila is better for the 
>> following reasons:
>> 1. it is a library solution
>> 2. allows both the user and the author of a library to specify 
>> functions with named parameters
>> 3. it is very lightweight
>>
>> [...]
>
> You miss the other reason on why it is not enough: Compile time 
> and run-time performance penalty.
> -Alex

I have messed with kwargs and compile time doesn't seem to be an 
issue. At least it is not noticeable to me and I have a quite old 
dual core cpu.

What kind of runtime penalty do you incur when using the library?
To me it seems that the only penalty would be error messages.
Also, kwargs allows unordered arguments and that is the path of 
lowest friction for people coming from languages with named 
parameters function (python on top of my mind).
It makes sense if you want to improve readibility.



More information about the Digitalmars-d mailing list