Solving the impossible?

Paul Backus snarwin at gmail.com
Wed Aug 29 21:14:59 UTC 2018


On Wednesday, 29 August 2018 at 19:56:31 UTC, Everlast wrote:
> One of the things that makes a good language is it's internal 
> syntactic consistency. This makes learning a language easier 
> and also makes remembering it easier. Determinism is a very 
> useful tool as is abstraction consistency. To say "Just except 
> D the way it is" is only because of necessity since that is the 
> way D is, not because it is correct. (There are a lot of 
> incorrect things in the world such as me "learning" D... since 
> I've been programming in D on and off for 10 years, I just 
> never used a specific type for variadics since I've always use 
> a variadic type parameter)
>
> To justify that a poor design choice is necessary is precisely 
> why the poor design choice exists in the first place. These are 
> blemishes on the language not proper design choices.  For 
> example, it is necessary for me to pay taxes, but it does not 
> mean that taxes are necessary.

The syntax *is* consistent. In `foo(int[] a...)`, `int[]` is the 
type of the parameter, and `a` is its name. This is consistent 
with how all other function parameters are declared. The only 
difference is in how arguments are bound to that parameter. 
That's what the `...` signifies: that a single parameter will 
accept multiple arguments. It's really quite straightforward and 
orthogonal.


More information about the Digitalmars-d-learn mailing list