From: Warren on
Thomas L�cke expounded in news:4bccb39a$0$279$14726298(a)news.sunsite.dk:

> Colin Paul Gloster wrote:
>> 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?
>
> John Barnes spends a lot of time throughout the book explaining how the
> with/use clauses work, how library units work, how the
> scope/visibility/accesibility systems works and how packages work. He
> does not blindly "abuse" the use keyword. Quote:
...
> As a beginner I've had much joy out of reading the John Barnes book. It
> deals with a complicated subject matter in clear and concise manner.

I agree. I still have and frequently review my copy of the '95
version of the book. The '05 version is still too pricey for
my liking, even used. I can wait for it.

Warren.
From: Georg Bauhaus on
Thomas L�cke schrieb:

> I think the examples in the book are very clear, if you bother to
> actually READ the book, and not treat it like an Ada cookbook. So from
> this beginner the book gets two thumbs up. :o)


> With that said, I would personally like a book on Ada with a more
> cookbook like approach, especially if it had a chapter on project files
> and compiling in general.

About the Why and How of compilation units and such:

http://archive.adaic.com/standards/83rat/html/ratl-10.html


Some of the documentation accompanying compilers is good
at explaining (and motivating) things. I found the GNAT UG
and the AppletMagic notes and articles to be valuable resources.
From: Adam Beneschan on
On Apr 19, 11:20 am, "John B. Matthews" <nos...(a)nospam.invalid> wrote:
> In article <hqhod3$ti...(a)news.eternal-september.org>,
>  "J-P. Rosen" <ro...(a)adalog.fr> 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.

-- Adam
From: John B. Matthews on
In article
<30c5b01f-8620-4aa7-8bd1-8e39e0fa5296(a)z21g2000pre.googlegroups.com>,
Adam Beneschan <adam(a)irvine.com> wrote:

> On Apr 19, 11:20 am, "John B. Matthews" <nos...(a)nospam.invalid> wrote:
> > In article <hqhod3$ti...(a)news.eternal-september.org>,
> >  "J-P. Rosen" <ro...(a)adalog.fr> 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
<http://sites.google.com/site/drjohnbmatthews>
From: brett on
Alex, Thank you for your book list, your comments are much appreciated in sorting out what book to try and aquire next.

---
frmsrcurl: http://compgroups.net/comp.lang.ada/confusion-with-string-initialization