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=unavailable autolearn_force=no version=3.4.4 Path: border1.nntp.dca3.giganews.com!border3.nntp.dca.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!ottix-news.ottix.net!newsswitch.lcs.mit.edu!nntp.TheWorld.com!.POSTED!not-for-mail From: Robert A Duff Newsgroups: comp.lang.ada Subject: Re: Elaboration order handling (Was: Bug in 'gnatmake') Date: Fri, 21 Jun 2013 19:47:41 -0400 Organization: The World Public Access UNIX, Brookline, MA Message-ID: References: <7f33982d-3bcf-452e-a3b3-3a0a28505ff1@x20g2000vbe.googlegroups.com> <87r4g0g9c0.fsf@adaheads.sparre-andersen.dk> <87ip1bg4z2.fsf_-_@adaheads.sparre-andersen.dk> <53d0b070-a03b-43d0-a560-68dd3a8bebf5@googlegroups.com> <51c218df$0$6623$9b4e6d93@newsspool2.arcor-online.net> NNTP-Posting-Host: shell01.theworld.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: pcls6.std.com 1371858462 11818 192.74.137.71 (21 Jun 2013 23:47:42 GMT) X-Complaints-To: abuse@TheWorld.com NNTP-Posting-Date: Fri, 21 Jun 2013 23:47:42 +0000 (UTC) User-Agent: Gnus/5.1008 (Gnus v5.10.8) Emacs/21.3 (irix) Cancel-Lock: sha1:YecHLZ2FhldpbVaaB2gJOIIkC8g= X-Original-Bytes: 3176 Xref: number.nntp.dca.giganews.com comp.lang.ada:182018 Date: 2013-06-21T19:47:41-04:00 List-Id: Jeffrey Carter writes: > On 06/21/2013 01:43 PM, Adam Beneschan wrote: >> Well, it could have, prior to Ada 2005. That's no longer possible, because >> of null procedures. > > Ah, yes, another unnecessary shortcut. It is important to the way interfaces work that procedures can be known to do nothing on their SPEC. I suppose it would be possible to allow "is begin null; end;" on the spec, but that would be more complicated -- requires either special syntax rules, or special semantic rules. So "is null;" makes sense for that. It is also useful for optimization purposes for procedures to be known to do nothing. E.g. Finalize defaults to doing nothing, so a type that does not override Finalize can be optimized to avoid finalization overhead, without looking at bodies of non-visible things. > I addressed this in detail in a reply to Duff. Basically, I find it hard > to find a specific declaration when reading such languages. It takes some getting used to, but I don't find it onerous. You already need to search for things in Ada as it is -- the declaration could be in some outer block or procedure or parent package or some use-claused package. And in some cases, it makes it EASIER to find the declaration, because it comes just before. Compare: X, Y : T; Init (X, Y); ... -- 100 lines begin versus: X, Y : T; ... -- 100 lines begin Init (X, Y); -- far away from X and Y - Bob