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: dewar@merv.cs.nyu.edu (Robert Dewar) Subject: Re: Equality operator overloading in ADA 83 Date: 1997/04/28 Message-ID: #1/1 X-Deja-AN: 237920974 References: <01bc4e9b$ac0e7fa0$72041dc2@lightning> <335F5971.6375@elca-matrix.ch> <5jvlt7$54b@mulga.cs.mu.OZ.AU> <5k2081$oms@mulga.cs.mu.OZ.AU> Organization: New York University Newsgroups: comp.lang.ada Date: 1997-04-28T00:00:00+00:00 List-Id: Fergus said << - the names of operators - the names of procedures for which the compiler generates inline code - names to special-case when doing name mangling>> OK, that's a very unusual (and I would think rather inconvenient and inefficient) approach. The normal way of handling strings like this in a compiler is to enter them into a hashed name table early on, and then use keys to reference them from there on -- that way you do not have strings wandering around the place. That's certainly something I teach as a standard compiler technique in my compilers course. For an example, see the Namet package in GNAT. Certainly if names are wandering around as strings in your compiler, I see how you would have case statements of this kind around! Note that if you use a discrete type for the key, you can then write case statements, for example, we could write in GNAT for the test of sopecial names of procedures that atr intrinsic (the second case you mention) case Name (Node) is when Name_Divide => when Name_Plus => ... we would of course need a when others, but that you need naturally in this case anyway.