On 28/04/12 20:47, Walter Bright wrote:
Andrei and I had a fun discussion last night about this question. The
idea was which features in D are redundant and/or do not add significant
value?

A couple already agreed upon ones are typedef and the cfloat, cdouble
and creal types.

What's your list?

Other ones which were agreed to a long time ago were:

* NCEG operators

* built-in .sort and .reverse

=============================

About the NCEG operators -- the reason they're redundant is that you practically always want to treat NaN separately.

I've tried _very_ hard to come up with uses for them, but without success.

The thing I've used the most is:
x !<>= x

which is a kind of built-in isNaN(x), but that can also be rewritten as:
x != x

Initially I though you'd do things like

real func(real x)
{
// x must be non-NaN and in the range -x.infinity .. N
  if (x !< N)
      return real.nan;

but even that isn't convincing, because if x is NaN you should be returning x, so that you preserve NaN payloads.

I think I have used these guys more than anyone else, but I still haven't found a single use case that stands up to scrutiny.

Reply via email to