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.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,1e3f2eac5c026e3 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-12-28 03:38:10 PST Path: archiver1.google.com!news2.google.com!fu-berlin.de!uni-berlin.de!dialin-145-254-038-053.arcor-ip.NET!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: Other Ada Standards (was Re: SIGada Conference) Date: Sun, 28 Dec 2003 12:44:31 +0100 Organization: At home Message-ID: References: <468D78E4EE5C6A4093A4C00F29DF513D04B82B08@VS2.hdi.tvcabo> <3FE991DD.5060301@noplace.com> <3FEA5C82.8050309@noplace.com> <3FEB047A.1040100@noplace.com> Reply-To: mailbox@dmitry-kazakov.de NNTP-Posting-Host: dialin-145-254-038-053.arcor-ip.net (145.254.38.53) Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7Bit X-Trace: news.uni-berlin.de 1072611489 13909074 145.254.38.53 ([77047]) User-Agent: KNode/0.7.2 Xref: archiver1.google.com comp.lang.ada:3880 Date: 2003-12-28T12:44:31+01:00 List-Id: Georg Bauhaus wrote: > Dmitry A. Kazakov wrote: > : Georg Bauhaus wrote: > : > :> For the "with and use" case, what is your interpretation of > :> "with and use A.B;" > :> Is it "with A.B; use A.B;" or is it "with A; use A.B;"? > :> Which interpretation is to be chosen? > : > : Just allow "with" everywhere "use" is allowed. Then "use A.B" could > : literally imply "with A.B". > > Hm. > > if condition then -- not Ada > declare > with X; > begin > ...; > end; > else > declare > with Y; > begin > ... > end; > end if; > > What is the compiler to do? Where is any problem? Exactly this is already allowed! Consider: procedure With_X is separate; procedure With_Y is separate; ... if Condition then -- Now this is Ada With_X; else With_Y; end if; with X; separate (...) procedure With_X is ... end With_X; with X; separate (...) procedure With_Y is ... end With_Y; > : package X is > : -- public things > : > : private > : with Something_Implementational.Not_To_Expose; > : > : package Y is > : package Debug is -- I'll comment it out, later > : with Ada.Text_IO; > : ... > : end Debug; > > why not > > with Ada.Text_IO; > private package Y.Debug is > > end Y.Debug; > > Do you need the Debug things in further private definitions > after Debug? I wished to illustrate a use of with in a nested declarative region. Technically one could always make a child package out of it. Though, not always, a child of a generic package is also generic... > : I think it is worth to investigate the possible consequences of this > : proposal. > > We might end up with > > package P is > > from Ada.Text_IO import Get_Line, Put_Line; --) > > ... > end P; Or with getting rid of with clauses at all, as Robert Duff mentioned in passing! I never liked them. How about that? -- Regards, Dmitry A. Kazakov www.dmitry-kazakov.de