[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Overloading of primitive operators
- To: CommonLoops.pa@Xerox.COM
- Subject: Overloading of primitive operators
- From: Nat Ballou <ballou@ERNEST.ACA.MCC.COM>
- Date: Tue, 13 Mar 90 14:15 CST
- Phone: (512) 338-3376
- Postal-address: 3500 West Balcones Ctr. Dr., Austin, TX 78759
- Redistributed: CommonLoops.pa
One (of the few?) advantage(s) that C++ holds over CLOS is the ability to
overload the primitive operators in C. For example, C++ allows one to overload
the equivalent Common Lisp operators eq, aref, not, +, -, *, /, mod, >, <, etc.
I am under the impression that ANSI Common Lisp (with CLOS) will not allow such
operators to be overloaded. Is this correct? If so, why?
The ability of to overload the primitive language operators can greatly
simplify the syntax of classes which are specializations of CL types (i.e., a
sparse matrix class or a persistent, extendible hash class). It would be rather
ironic if C++, with its rather small reserved namespace, allowed such
overloading, whereas ANSI CL, with an enormous reserved namespace, did not.