Flag proposal
bearophile
bearophileHUGS at lycos.com
Fri Jun 10 14:02:59 PDT 2011
Andrei:
> We should be much more restrained than this discussion suggests. Any and
> all programming languages have limitations. This, coupled with the
> former point, leads to the fact that at some point you MUST look into
> doing within the language something that could be done nicer if you got
> to play God. Doing the latter does not scale.
This use of word "scale" assumes there is a larger and larger group of basic features that we'll desire in the language. But I have experience both of "normal" languages and of languages with macros as Scheme, and I don't think this is true. In the next few years we will not want to add a large and growing number of basic features to D2/D3.
And currently in D there are features much less generally useful than named arguments or tuple unpacking syntax sugar, as Delimited Strings, Lazy Variadic Functions and more.
> So, does Flag work around a limitation in the language? Sure. Would a
> language-changing solution work better? Absolutely. Is the necessity of
> changing the language a foregone conclusion? I don't think so.
Named arguments offer a more general solution than Flags, useful for all kinds of arguments, with a more readable syntax. I don't think you need a sub-feature to _require_ the argument name at the call point (on the other hand you may desire a sub-feature Scala has, to support deprecation of argument names. This helps solve a problem Don too has with named arguments).
Bye,
bearophile
More information about the Digitalmars-d
mailing list