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

JN 666total at wp.pl
Wed Feb 27 18:16:32 UTC 2019


On Wednesday, 27 February 2019 at 12:49:52 UTC, Joseph Rushton 
Wakeling wrote:
> If we consider the languages where named arguments are a 
> feature, virtually all of them are scripting (or scriptable) 
> languages where it's common to use them via a REPL, and the 
> use-case is for functions that have a lot of parameters, where 
> in the typical use-case the caller only wants to specify the 
> ones that are non-default.

Virtually all of them is a bit of a simplification. C#, Kotlin, 
Swift, Dart, Objective-C are definitely not scripting languages 
and they aren't primarily used through repr, and they all support 
named/keyword arguments in some form.

> As others have already pointed out, it needs only some small 
> improvements to the struct declaration mechanisms to allow us 
> to do something like:
>
> ```
> foo({ beta: 6.5, omega: 101 });
> ```
>

This would be great.


More information about the Digitalmars-d mailing list