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,c3a7c1845ec5caf9 X-Google-Attributes: gid103376,public From: fjh@mundook.cs.mu.OZ.AU (Fergus Henderson) Subject: Re: Equality operator overloading in ADA 83 Date: 1997/04/27 Message-ID: <5jvlt7$54b@mulga.cs.mu.OZ.AU>#1/1 X-Deja-AN: 237708413 References: <01bc4e9b$ac0e7fa0$72041dc2@lightning> <335F5971.6375@elca-matrix.ch> Organization: Comp Sci, University of Melbourne Newsgroups: comp.lang.ada Date: 1997-04-27T00:00:00+00:00 List-Id: dewar@merv.cs.nyu.edu (Robert Dewar) writes: >I still think that the utility is marginal in real programs, I looked for >the elsif pattern that would correspond to this case sequence, and found >*very* few examples in the millions of lines of code in our regression >suite (always an interesting place to look, since it represents code from >many places). FWIW, I have some data that may be relevant. The Mercury language includes support for the equivalent of string case statements, and for switches that meet a minimum size requirement (8 cases), the Mercury compiler generates hash tables to index such switches. I did a quick grep for `hash_string' in the generated code, and found that for the Mercury compiler itself (108 thousand lines of Mercury source, or 80 thousand if you exclude whitespace and comment lines), there where 15 such occurrences, spread over 12 of the 126 modules, or about one for every 5 thousand non-comment non-whitespace line of code. (That figure doesn't count string switches with 7 or less cases, for which the Mercury compiler currently generates code using if-then-else chains.) I leave it to the reader to judge what conclusions should be drawn from this data. -- Fergus Henderson | "I have always known that the pursuit WWW: | of excellence is a lethal habit" PGP: finger fjh@128.250.37.3 | -- the last words of T. S. Garp.