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-Thread: 103376,c58a5b8372dc24a0 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,UTF8 Path: g2news2.google.com!news4.google.com!feeder.news-service.com!188.40.43.213.MISMATCH!feeder.eternal-september.org!eternal-september.org!aioe.org!not-for-mail From: "John B. Matthews" Newsgroups: comp.lang.ada Subject: Re: confusion with string initialization Date: Mon, 19 Apr 2010 23:37:31 -0400 Organization: The Wasteland Message-ID: References: <30c5b01f-8620-4aa7-8bd1-8e39e0fa5296@z21g2000pre.googlegroups.com> NNTP-Posting-Host: LQJtZWzu+iKlBROuDg+IUg.user.speranza.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Complaints-To: abuse@aioe.org X-Notice: Filtered by postfilter v. 0.8.2 User-Agent: MT-NewsWatcher/3.5.3b3 (Intel Mac OS X) Xref: g2news2.google.com comp.lang.ada:11055 Date: 2010-04-19T23:37:31-04:00 List-Id: In article <30c5b01f-8620-4aa7-8bd1-8e39e0fa5296@z21g2000pre.googlegroups.com>, Adam Beneschan wrote: > On Apr 19, 11:20 am, "John B. Matthews" wrote: > > In article , > >  "J-P. Rosen" wrote: > > > > > Colin Paul Gloster a écrit : > > > > > > Why did you consider a book which makes which packages things are > > > > in unclear by mutiliating programs by means of the USE keyword to > > > > be excellent? > > > > > Because it makes lisibility a lot better by drawing attention of the > > > reader on what actually the thing does, and getting rid of useless > > > information that you can find easily by clicking on the identifier > > > and selecting "go to declaration". > > > > > (Ok, Ok, I'm a bit provocative here, but I'm tired of seeing people > > > jumping on beginners and insisting on a notation that can drive them > > > away of the language screaming). > > > > Preferring not to overuse "use", I recall becoming an instant fan of > > "use type" when it was introduced in Ada '95. Is there a way to make > > Ada.Strings.Fixed."*" visible without the use clause? > > With a renaming declaration. > > Before Ada 95 came out, I often included a nested package named > OPERATORS in packages that I wrote, in order to facilitate making > operators visible (often just "="). This package would contain > renaming declarations for the operators I wanted to make visible. > Then, instead of having to USE the whole package, I could say "use > Pkg.OPERATORS" to make just the desired names visible. That would > still work (and the package doesn't have to be nested). You can write > your own package > > with Ada.Strings.Fixed; > package Fixed_Operators is > function "*" (Left : in Natural; > Right : in Character) return String > renames Ada.Strings.Fixed."*"; > function "*" (Left : in Natural; > Right : in String) return String > renames Ada.Strings.Fixed."*"; > end Fixed_Operators; > > and now "use Fixed_Operators;" will give you what you're looking for. > (Caveat: I have not tested the above code.) Technically, I guess this > doesn't answer your question about how to make the operators visible > "without the use clause" [on a package], but it should be acceptable > since it only makes visible certain specific things that you *want* to > make visible, without making anything else visible that you don't want > visible. Thanks for responding, Adam. That's exactly what I was looking for. My usual cohorts have sensible "use" policies, but one likes to be prepared. :-) -- John B. Matthews trashgod at gmail dot com