home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / lang / eiffel / 1418 < prev    next >
Encoding:
Text File  |  1993-01-12  |  1.1 KB  |  32 lines

  1. Newsgroups: comp.lang.eiffel
  2. Path: sparky!uunet!elroy.jpl.nasa.gov!ufo!jato!csi!mwette
  3. From: mwette@csi.jpl.nasa.gov (Matt Wette)
  4. Subject: how to handle binary operators
  5. Message-ID: <1993Jan12.161940.5604@csi.jpl.nasa.gov>
  6. Originator: mwette@mr-ed
  7. Sender: usenet@csi.jpl.nasa.gov (Network Noise Transfer Service)
  8. Nntp-Posting-Host: mr-ed
  9. Organization: Jet Propulsion Laboratory
  10. Date: Tue, 12 Jan 1993 16:19:40 GMT
  11. Lines: 19
  12.  
  13.  
  14. I haven't programmed in Eiffel, but have read the OOSC book.  One
  15. thing I haven't been able to figure out is how to construct overloaded
  16. operators for mixed classes.  For example, say I want to construct a
  17. class REGEMAT for real general matrices (real coefficients, no special
  18. structure).  Then I can define (don't have my book here so syntax may
  19. be off a bit)
  20.  
  21.   feature 
  22.     "*"(b: REGEMAT):REGEMAT is ... -- code for REGEMAT*REGEMAT
  23.     "*"(b: REAL): REGEMAT is ...   -- code for REGEMAT*REAL
  24.   
  25. But how do I handle the case for REAL*REGEMAT where REAL is a
  26. previously defined class?  It seems this sort of thing is not possible
  27. in Eiffel, or is it? 
  28.  
  29. Matt
  30. -- 
  31. mwette@csi.jpl.nasa.gov
  32.