From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,c7d533acec91ae16 X-Google-Attributes: gid103376,public From: Samuel Mize Subject: Re: Question for the folks who designed Ada95 Date: 1999/04/27 Message-ID: <7g4mic$1sr0@news2.newsguy.com>#1/1 X-Deja-AN: 471525538 References: <7g2qu4$ca4$1@usenet.rational.com> <7g4jqm$1rkg@news1.newsguy.com> Organization: ImagiNet Communications, Ltd. User-Agent: tin/pre-1.4-981002 ("Phobia") (UNIX) (AIX/3-2) Newsgroups: comp.lang.ada Date: 1999-04-27T00:00:00+00:00 List-Id: Samuel Mize wrote: > Corey Ashford wrote: >> >> About modular types. > ... >> Why didn't Ada95 make a shift operator a first-class >> operator on modular types. I looked again at Matthew Heany's response, and this time noted the second A. For those who don't know, the AARM is the Annotated Ada Reference Manual. His reference, AARM B.2 (9.a), says that they didn't want to add a new operator, and that "all predefined operations should be operators (not functions named by identifiers)." I'm not sure what that means, in light of existing Intrinsic attribute functions like 'Min and 'Pred. Besides the points in my other post, I'd note that Ada generally assumes you're using a compiler that optimizes well, if optimization is an issue. So we expect the compiler to manage things like deciding whether to shift or divide, and the programmer manage things like data structures, algorithms and high-level programming constructs. If you have to hand-optimize a million-line program, you're doomed anyway. When you *do* need to worry about it, for some small program or for a crucial section, you can generally find an optimal way to code things. But this isn't the first concern of the language, so the first approach you think of won't always be the right one. If you have to worry about line-by-line efficiency, you really have to cuddle up to your compiler and learn a lot about it. But that's true for any language. It's easier in C to convince yourself that you're hand-optimizing something, but I've seen cases where doing so caused SLOWER execution times, because the higher-level version was more amenable to machine optimization. Best, Sam Mize -- Samuel Mize -- smize@imagin.net (home email) -- Team Ada Fight Spam: see http://www.cauce.org/ \\\ Smert Spamonam