home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.eiffel
- Path: sparky!uunet!elroy.jpl.nasa.gov!ufo!jato!csi!mwette
- From: mwette@csi.jpl.nasa.gov (Matt Wette)
- Subject: how to handle binary operators
- Message-ID: <1993Jan12.161940.5604@csi.jpl.nasa.gov>
- Originator: mwette@mr-ed
- Sender: usenet@csi.jpl.nasa.gov (Network Noise Transfer Service)
- Nntp-Posting-Host: mr-ed
- Organization: Jet Propulsion Laboratory
- Date: Tue, 12 Jan 1993 16:19:40 GMT
- Lines: 19
-
-
- I haven't programmed in Eiffel, but have read the OOSC book. One
- thing I haven't been able to figure out is how to construct overloaded
- operators for mixed classes. For example, say I want to construct a
- class REGEMAT for real general matrices (real coefficients, no special
- structure). Then I can define (don't have my book here so syntax may
- be off a bit)
-
- feature
- "*"(b: REGEMAT):REGEMAT is ... -- code for REGEMAT*REGEMAT
- "*"(b: REAL): REGEMAT is ... -- code for REGEMAT*REAL
-
- But how do I handle the case for REAL*REGEMAT where REAL is a
- previously defined class? It seems this sort of thing is not possible
- in Eiffel, or is it?
-
- Matt
- --
- mwette@csi.jpl.nasa.gov
-