Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!purdue!ames!henry.jpl.nasa.gov!elroy.jpl.nasa.gov!ucla-cs!uci-ics!sludwig
From: sludwig@ics.uci.edu (Stefan Ludwig)
Newsgroups: comp.lang.modula2
Subject: Re: Defining Operators
Summary: feel free to do it !
Keywords: Modula-2, operator overloading
Message-ID: <1989Sep30.050044.12442@paris.ics.uci.edu>
Date: 30 Sep 89 05:00:44 GMT
References: 
Sender: news@paris.ics.uci.edu (Network News)
Reply-To: Stefan Ludwig 
Organization: University of California, Irvine - Dept of ICS
Lines: 32

In article  Modula2 List  writes:
[stuff deleted]
>    Which (algebraically) reads exactly as you mean it.  In Ada you can
>  define the '+' operator to be able to handle the Complex number type.
>
>    Would such a feature be warranted in Modula-2?
>
>    Here is some theoretical code:
[stuff deleted]
>    The compiler or translator could substitute the necessary procedure
>  and make sure that the correct types are being used.
>    Thus, the compilable code would look like:
[stuff deleted]
I recently suggested operator overloading to Prof. Wirth. His argument is:
the possibility you gain for coding programs does not justify the added
complexity to the compiler. This guy is running for 'the smallest compiler
in the world'-contest. His compilers are *really* small and *fast*.
The Oberon compiler for the Ceres (NS32000 based) is just 39KB object code!
It sure would be a nice feature to have, especially when you have object-
oriented features (like in Object-Oberon). We're thinking about adding that
to our Object-Oberon compiler...We'll see, just stay tuned.
>
>    Alex
>    Just this guy...

	Stefan

Stefan HM Ludwig	"Don't flame my english, it's what
			 they teach us in Swiss schools"

E-MAIL:		sludwig@ics.uci.edu		until October 21st
		ludwig@badile.iis.ethz.ch	later