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

RE: Overloading of primitive operators



  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