Regarding the proposed Binray Literals Deprecation
Max Samukha
maxsamukha at gmail.com
Wed Sep 14 07:09:50 UTC 2022
On Wednesday, 14 September 2022 at 05:58:53 UTC, Walter Bright
wrote:
> People often complain that D has too many features. What
> features would you say are not worth it?
Hex/binary/octal literals are perceived as a single feature.
Removing some of them would actually complicate the language by
introducing an inconsistency into that feature (see Timon's post).
What really simplifies a language is removal of inconsistencies
and special cases, and also improvement of interactions between
features. For example, we are now struggling with the
impossibility to perfectly forward a variadic function call:
```
void bar(short a)
{
}
void foo(alias target, A...)(auto ref A args)
{
target(forward!args);
}
void main()
{
bar(1); // ok
foo!bar(1); // error because args[0] is inferred as int
}
```
We now have to force superfluous casts on the API user, or resort
to all kinds of metaprogramming hackery, or go back to Java-style
monkey-coding.
More information about the Digitalmars-d
mailing list