What's the original rationale for requiring that hex float literals must
always have an exponent? For example, 0xFFi obviously must be float, not
integer, so why does the compiler (and the spec) require an exponent?
Also, the specs say:
FloatLiteral:
Float
Float Suffix
...
Float:
DecimalFloat
HexFloat
Suffix:
FloatSuffix
...
FloatSuffix:
f
F
This is ambiguous, since you could interpret 0xFFp0F as either 0xFFp0
followed by the suffix 'F', or 0xFFp0F with an exponent of 0x0F no
suffix.
T
--
It is widely believed that reinventing the wheel is a waste of time; but
I disagree: without wheel reinventers, we would be still be stuck with
wooden horse-cart wheels.

What's the original rationale for requiring that hex float literals must
always have an exponent? For example, 0xFFi obviously must be float, not
integer, so why does the compiler (and the spec) require an exponent?

What's the original rationale for requiring that hex float literals must
always have an exponent? For example, 0xFFi obviously must be float, not
integer, so why does the compiler (and the spec) require an exponent?

The syntax comes from C99.

Do you mean the syntax has just been copied straight from C99 without any
thought about
making it more lenient?
Stewart.

What's the original rationale for requiring that hex float literals must
always have an exponent? For example, 0xFFi obviously must be float, not
integer, so why does the compiler (and the spec) require an exponent?

The syntax comes from C99.

Do you mean the syntax has just been copied straight from C99 without
any thought about making it more lenient?
Stewart.

Yes. There would need to be a good reason to do so.
For the case in question, note that mathematically, imaginary integers
are perfectly valid. Would an imaginary integer literal be an idouble, a
ifloat, or an ireal? I don't think it could be any:
foor(float x)
foor(double x)
fooi(ifloat x)
fooi(idouble x)
foor(7); //ambiguous, doesn't compile
fooi(7i); // by symmetry, this shouldn't compile either

What's the original rationale for requiring that hex float literals
must
always have an exponent? For example, 0xFFi obviously must be float,
not
integer, so why does the compiler (and the spec) require an exponent?

The syntax comes from C99.

Do you mean the syntax has just been copied straight from C99 without
any thought about making it more lenient?
Stewart.

Yes. There would need to be a good reason to do so.
For the case in question, note that mathematically, imaginary integers
are perfectly valid. Would an imaginary integer literal be an idouble, a
ifloat, or an ireal? I don't think it could be any:
foor(float x)
foor(double x)
fooi(ifloat x)
fooi(idouble x)
foor(7); //ambiguous, doesn't compile
fooi(7i); // by symmetry, this shouldn't compile either

What's the original rationale for requiring that hex float literals
must
always have an exponent? For example, 0xFFi obviously must be float,
not
integer, so why does the compiler (and the spec) require an exponent?

The syntax comes from C99.

Do you mean the syntax has just been copied straight from C99 without
any thought about making it more lenient?
Stewart.

Yes. There would need to be a good reason to do so.
For the case in question, note that mathematically, imaginary integers
are perfectly valid. Would an imaginary integer literal be an idouble, a
ifloat, or an ireal? I don't think it could be any:
foor(float x)
foor(double x)
fooi(ifloat x)
fooi(idouble x)
foor(7); //ambiguous, doesn't compile
fooi(7i); // by symmetry, this shouldn't compile either

What's the original rationale for requiring that hex float literals
must
always have an exponent? For example, 0xFFi obviously must be float,
not
integer, so why does the compiler (and the spec) require an exponent?

The syntax comes from C99.

Do you mean the syntax has just been copied straight from C99 without
any thought about making it more lenient?
Stewart.

Yes. There would need to be a good reason to do so.
For the case in question, note that mathematically, imaginary integers
are perfectly valid. Would an imaginary integer literal be an idouble, a
ifloat, or an ireal? I don't think it could be any:
foor(float x)
foor(double x)
fooi(ifloat x)
fooi(idouble x)
foor(7); //ambiguous, doesn't compile
fooi(7i); // by symmetry, this shouldn't compile either

static assert(is(typeof(7i)==idouble));

Ooh, that's bad.

Indeed. But the implementation of complex and imaginary numbers is
pretty much broken in the front-end anyway. For example, double and
idouble are type combined to double iirc.