jacob navia wrote, On 26/12/07 15:40:
Eric Sosman wrote:
[snip]
Finally, operator overloading is by no means the only fad you
promote. Your exact words were "many things that are necessary in
a modern software development environment," with no limitation on
or characterization of all these so-called "necessities."
I have published a document that contains my proposal in a very
detailed way. I can send it to you, but the
core of them is
o operator overloading
o references
o generic functions
OK, so you want to add three things I don't have any use for in my work
in C and none of the things that would make my life easier.
You do not want to discuss with any objectivity. Of course
the suggestions *I* do are the ones *I* consider right!
I explained all of them and why they are needed.
Others have explained why they are not needed or could be considered
undesirable.
They are needed for numerical calculations. The problem is that
not everyone does that.
Not everyone does floating point arithmetic either.
Fixed point numbers ARE needed in machines where there is no floating
point hardware. Problem, not everyone has that environment.
OK, so you don't understand a lot of the reasons for fixed point
arithmetic. I would find it useful on high end Windows, Linux and AIX
servers.
Decimal floating point numbers ARE needed for doing exact
accounting calculations. Problem, not everyone is doing that.
The solution I propose would solve ALL those problems with
a SINGLE change.
No it would not. With your solution I would have to implement 1db
numbers, 2db numbers, 3dp numbers, 4dp numbers and 5dp numbers, all the
operations between those in all combinations and all combinations with
the existing numbers. Then I would have to hope the compiler was
intelligent enough to do something sensible. Not to mention the output
code. For decimal floating point I would have to resort to assembler,
since nothing I did would be likely to make use of the HW support for
decimal floating point.
All in all, built in support by the compiler is by far the preferable
solution.
Use standard notation (+ - * or / ) to add, subtact multiply or
divide new kinds of numbers Eric, that's what I am saying again and
again.
You get that if it is implemented as part of the compiler, and that way
the numeric types and all the interesting rules only have to be
implemented by the compiler writers and not by the application developers.