🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.eiffel
Article #1104

how to handle binary operators

#1104
From: Matt Wette
Date: Tue, 12 Jan 1993 16:19
19 lines
1145 bytes
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
Technical Details
Message-ID: <1993Jan12.161940.5604@csi.jpl.nasa.gov>
Path: arc1-ca.pugleaf.net!sparky!uunet!elroy.jpl.nasa.gov!ufo!jato!csi!mwette

Show Full Headers
Complete Article Headers
Newsgroups: comp.lang.eiffel
Path: arc1-ca.pugleaf.net!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