[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: Overloading of primitive operators
- To: CommonLoops.pa@Xerox.COM
- Subject: RE: Overloading of primitive operators
- From: Nat Ballou <ballou@ERNEST.ACA.MCC.COM>
- Date: Thu, 15 Mar 90 17:33 CST
- Phone: (512) 338-3376
- Postal-address: 3500 West Balcones Ctr. Dr., Austin, TX 78759
- Redistributed: CommonLoops.pa
Shadowing the symbols doesn't mean that you can't use the LISP package.
Here's a quick and dirty example:
[...]
You are now free to define your own methods for + and - which are
specialized on any class you like, including, but not limited to,
subclasses of NUMBER.
But if I do this, for any package to use my package's definition of +, it too
must shadow the +. Such a package better shadow such symbols before using
the LISP package, and heavens forbid if some package other than mine also
pulls the same trick on the operator +...
The idea of using shadowed symbols is not a real solution since one has
really introduced a new symbol (i.e., the symbols have the same name, but
are two different symbols). In C++, the user of an overloaded primitive
operator does not need to do anything special.
Nat