Re: Definable operators

nmm1@cus.cam.ac.uk (Nick Maclaren)
23 Mar 1997 23:24:21 -0500

          From comp.compilers

Related articles
Problems with Hardware, Languages, and Compilers hrubin@stat.purdue.edu (1997-03-07)
Re: Definable operators Dik.Winter@cwi.nl (1997-03-18)
Re: Definable operators fjh@murlibobo.cs.mu.OZ.AU (1997-03-18)
Re: Definable operators nmm1@cus.cam.ac.uk (1997-03-21)
Re: Definable operators henry@zoo.toronto.edu (Henry Spencer) (1997-03-22)
Re: Definable operators nmm1@cus.cam.ac.uk (1997-03-23)
Re: Definable operators fanf@lspace.org (Tony Finch) (1997-03-23)
Re: Definable operators Dave@occl-cam.demon.co.uk (Dave Lloyd) (1997-03-27)
Re: Definable operators henry@zoo.toronto.edu (Henry Spencer) (1997-03-31)
Re: Definable operators sethml@ugcs.caltech.edu (1997-03-31)
Re: Definable operators rivetchuck@aol.com (1997-04-02)
Re: Definable operators Dave@occl-cam.demon.co.uk (Dave Lloyd) (1997-04-02)
[32 later articles]
| List of all articles for this month |

From: nmm1@cus.cam.ac.uk (Nick Maclaren)
Newsgroups: comp.compilers,comp.lang.misc
Date: 23 Mar 1997 23:24:21 -0500
Organization: University of Cambridge, England
References: 97-03-037 97-03-112 97-03-115 97-03-141
Keywords: design

Henry Spencer <henry@zoo.toronto.edu> wrote:
>I heard an interesting rule of thumb recently -- although my leaky
>memory is now refusing to tell me who said it -- to the effect that
>operator overloading works very well so long as the data objects are
>*numbers* of some sort, or very close analogs of numbers, and very
>poorly otherwise. I think there's a lot of truth in that.


Yes and no. I have used them very successfully on objects that were
entirely non-numeric. But I am a pure mathematician by background,
and the objects I was operating on formed a ring (with a few slightly
odd extensions). I think that the real criterion is that they must be
the sort of object that can be handled by conventional axiomatic
mathematics and its standard notation.


They certainly work very well for matrices, under some circumstances
(the main one being that storage management problems are not an
issue).


Nick Maclaren,
University of Cambridge Computer Laboratory,
New Museums Site, Pembroke Street, Cambridge CB2 3QG, England.
Email: nmm1@cam.ac.uk
Tel.: +44 1223 334761 Fax: +44 1223 334679
--


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.