Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!caen!spool.mu.edu!uunet!mcsun!ukc!icdoc!sot-ecs!etj90 From: etj90@ecs.soton.ac.uk (Khaos) Newsgroups: comp.lang.c++ Subject: Re: taking powers with "^" Message-ID: <8300@ecs.soton.ac.uk> Date: 26 Jun 91 12:55:08 GMT Article-I.D.: ecs.8300 References: <1920003@hpsad.HP.COM> <1920004@hpsad.HP.COM> Sender: news@ecs.soton.ac.uk Lines: 31 Approved: Aha, orwight Originator: etj90@gloriana In <1920004@hpsad.HP.COM> sdw@hpsad.HP.COM (Steve Warwick) writes: >The fact that overloaded operators inheret the precedence of the >underlying operator has always seemed strange to me - it seems to >retrict the meaning of "overloading" and "operator definition", >although from the standpoint of readability, it seems like the right >thing to do. >For my purposes, making a pre-defined power operator a part of the >language would go a long way to obsoleting F**TRAN, since so many >other problems have been so elegently solved >However, people seem to like C++ as a "meta language", so a generic >operator definition feature fits the style better.... >This is a case where having the ability to define an operator, >such as "^^" or "@@" makes sense. ( also with a reletive precedence and >grouping preference ). This just gave me a Thought. Defining your own "meta-operators" would allow you to define things that aren't a normal language thing at all, such as foo@bar would allow you to e.g. booleanly test for the existence of foo in your Object bar (a database of some sort). If this is too woolly and 7th generation language-y then ignore it but defining your own operators (although I think retaining priorities of overloaded op's is a good idea) would be REELY K00L. Enough ranting. -- Quote: "I am Khaos !" \007, licensed to beep.