[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Overloading of primitive operators



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.

Nat Ballou
MCC