|language design tradeoffs firstname.lastname@example.org (1992-09-07)|
|Re: language design tradeoffs email@example.com (1992-09-17)|
|Operator Overloading and Meta-Operators firstname.lastname@example.org (1992-09-22)|
|From:||email@example.com (Lawrence Crowl)|
|Organization:||Oregon State University, Corvallis Oregon|
|Date:||Tue, 22 Sep 1992 00:14:50 GMT|
firstname.lastname@example.org (Bradley K. Sherman) writes:
> 3) No macros or overloading. Sorry, but x + y means add y to x.
I do not want it to mean place object y on window x.
Which add where you refering to? Fixed-length integer add,
variable-length integer add, fixed point add, floating point add, double
precision floating point add, complex add, rational add, interval add,
boolean add, vector of floats add, matrix of floats add, or something
I don't think we can avoid overloading, especially given the increased
number of "primitive" numeric types. What we probably can do is ask that
such operators all obey a reasonable set of arithmetic properties, e.g.
commutivity and associativity.
Mathematics has many such "meta-operators", and the use of "+" to signify
"the appropriate one" doesn't appear to be too much of a problem.
Programming languages have a more difficult task, but still it would be
useful if the programming community had more widely recognized
meta-operations like "put this item into that data structure", so that
programmers can use operators for common operations and still not suprise
other programmers by their choice of operator.
Lawrence Crowl 503-737-2554 Computer Science Department
email@example.com Oregon State University
...!hplabs!hp-pcd!orstcs!crowl Corvallis, Oregon, 97331-3202
Return to the
Search the comp.compilers archives again.