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.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,52fd60a337c05842 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-06-18 13:48:02 PST Newsgroups: comp.lang.ada Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!newsfeed.berkeley.edu!news-hog.berkeley.edu!ucberkeley!newshub.sdsu.edu!west.cox.net!cox.net!newsfeed1.earthlink.net!newsfeed.earthlink.net!uunet!lax.uu.net!dfw.uu.net!ash.uu.net!world!news From: Robert A Duff Subject: Re: ada paper critic Sender: news@world.std.com (Mr Usenet Himself) Message-ID: Date: Tue, 18 Jun 2002 20:47:00 GMT References: <3D0A399C.EF6F1BD9@acm.org> <3D0B4CCC.7010104@telepath.com> <3D0F853B.9040902@mail.com> NNTP-Posting-Host: shell01.theworld.com Organization: The World Public Access UNIX, Brookline, MA X-Newsreader: Gnus v5.7/Emacs 20.7 Xref: archiver1.google.com comp.lang.ada:26302 Date: 2002-06-18T20:47:00+00:00 List-Id: Hyman Rosen writes: > Robert A Duff wrote: > > plan old variable names use the same > > notation as parameterless calls. > > Don't forget that enumeration literals are considered > parameterless functions. It's this syntax which allows > different enumerations to share the same literals, yet > have them be disambiguated by overloading in context. > > A very elegeant bit of hackery! Nonsense. (Sorry. ;-)) The reasoning, apparently, was: 1. We only want to overload subprograms. 2. But we also want to overload enumeration literals. 3. Therefore enumeration literals must be subprograms. But the idea that enumeration literals are subprograms is patently nonsensical. It confuses people trying to learn the language. It complicates compilers. It provides no practical benefit (i.e. no gain in expressive power). It causes complication in the RM (if these things are subprograms, then when exactly are their bodies elaborated? Can calling them raise Program_Error?) The proper line of reasoning should have been 1, then 2, then "3. Therefore we must have been wrong about 1." Just define enumeration literals to be overloadable. And if enum lits can be overloaded, why can't (for example) constants (which are more like enum lits than enum lits are like functions)? Sorry, "elegeant" is not the term I would use to describe this bit of hackery. Numeric literals are also overloaded, in a sense, although the RM doesn't describe it that way. (For subtle reasons involving named numbers (another kludge), it's described in terms of implicit conversion.) Notations like aggregate notation are also overloaded. No attempt is made to call aggregates functions (although that makes some sense, at least for record aggregates). - Bob