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=-0.8 required=5.0 tests=BAYES_00,INVALID_DATE autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,57228cde5a9481bb X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 1994-10-19 11:42:55 PST Newsgroups: comp.lang.ada Path: bga.com!news.sprintlink.net!mv!news.mathworks.com!europa.eng.gtefsd.com!howland.reston.ans.net!pipex!uunet!olivea!news.bu.edu!inmet!dsd!bobduff From: bobduff@dsd.camb.inmet.com (Bob Duff) Subject: Re: Change to obscure visibility rule in 9x Message-ID: Sender: news@inmet.camb.inmet.com Organization: Intermetrics, Inc. References: Date: Wed, 19 Oct 1994 12:33:23 GMT Date: 1994-10-19T12:33:23+00:00 List-Id: In article , Simtel20 Transfer wrote: >Bob Duff writes: > 2.a Reason: The reason for making overloadable declarations with > profiles special is to simplify compilation: until the compiler has > determined the profile, it doesn't know which other declarations are > homographs of this one, so it doesn't know which ones this one should > hide. Without this rule, two passes over the _specification or > generic_instantiation would be required to resolve names that denote > things with the same name as this one. > >So the compiler has to look at a few hundred bytes of source code twice, >With today's 8MB and higher PCs that doesn't seem like any problem. The issue is not an efficiency issue, but a compiler complexity issue. Forcing the compiler to have a first pass to figure out the type profile of a given subprogram, then go back and decide which things are homographs of the subprograms, and then make a second pass, doing overload resolution on the default expressions, would be a large amount of extra complexity in the compiler, just to handle something silly that nobody would really want to write: "function F(X: Integer := F);". Of course you're right that compilers have plenty of memory to do this these days. In fact they probably had plenty of memory in 1983 -- subprogram specs aren't that big. But compiler complexity causes compiler bugs -- a Bad Thing. - Bob -- Bob Duff bobduff@inmet.com Oak Tree Software, Inc. Ada 9X Mapping/Revision Team (Intermetrics, Inc.)