Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!mips!spool.mu.edu!munnari.oz.au!brolga!uqcspe!cs.uq.oz.au!warwick From: warwick@cs.uq.oz.au (Warwick Allison) Newsgroups: comp.lang.modula2 Subject: Re: Overloading? Message-ID: <960@uqcspe.cs.uq.oz.au> Date: 24 Apr 91 06:40:16 GMT References: <209.2812FBE7@puddle.fidonet.org> Sender: news@cs.uq.oz.au Reply-To: warwick@cs.uq.oz.au Lines: 24 >Today, I was trying to implement a fixed-point math module in M2, >containing routines like Add, Sub, Mul, Div, etc. Using these routines >really clutters your source with statements like: > a := Add(Mul(b,c),d); >instead of the more readable: > a := b*c+d; If you have TYPE FIXED=INTEGER; then + and - work fine, so you don't need Add & Sub, but Mul and Div require shifting. Pity Modula-2 doesn't have Ada-like facilities for infix operators. Warwick. -- _-_|\ warwick@cs.uq.oz.au / * <-- Computer Science Department, \_.-._/ University of Queensland, v Brisbane, AUSTRALIA.