comp.lang.ada
 help / color / mirror / Atom feed
From: stt@spock.camb.inmet.com (Tucker Taft)
Subject: Re: GNAT newbie
Date: 1995/03/29
Date: 1995-03-29T00:00:00+00:00	[thread overview]
Message-ID: <D67nDw.Jux@inmet.camb.inmet.com> (raw)
In-Reply-To: 3l702t$kcn@twonky.btv.ibm.com

Dale Pontius (pontius@twonky.btv.ibm.com) wrote:

: ...
: As things have it, I'm looking at Ada95, and GNAT in particular. I
: don't like the size of the Ada language, but am preparing to try and
: use a reasonable subset. I do have a few questions:

: 1: Is there some sort of library overview? I see a bunch of .ads
:    files, and know that they're the equivalent of a .def file in
:    Modula-2, but the names aren't that informative without a roadmap.

The Ada 95 rationale includes a section that gives an overview
of the library.  You might want to start there.
The rationale is available by anonymous FTP from sw-eng.falls-church.va.us
in subdirectory public/adaic/docs/standard/95lrm_rat/v6.0.

: 2: Does Ada normally use pass-by-value or pass-by-reference? I've
:    looked at some of the examples and have seen parameters marked
:    with 'in out', which obviously must be by-reference, but how
:    about the normal case. I'm wondering about side effects and
:    performance.

Ada requires pass-by-copy for "elementary" types (numeric, enumeration, 
and access types).

Ada 95 requires pass-by-reference for certain "composite" types 
(roughly the "limited" types and the "tagged" types -- 
limited or tagged records, tasks, and protected types).
For other composite types (nonlimited/nontagged record and array types) 
Ada 95 allows the compiler to choose between pass-by-reference and 
pass-by-copy.  Most compilers use pass-by-reference for all
composite type parameters, unless they are very small (e.g. one or two words)
or are not aligned on a byte boundary (e.g. an unaligned slice of
a bit array).  However, in a distributed program (see Annex E), pass by
copy is used for all remote subprogram calls (actually, pass
by "marshalling"/"unmarshalling," which can be user-defined).

Note that "in out" does not imply pass-by-reference.  Pass-by-copy
"in out" is implemented by copy-in followed by copy-out.

: 3: Is there some sort of more concise description than the 500 page
:    non-annotated postscript document? I realize it may be more vague,
:    but I plan to stick to a more concrete subset of the language, at
:    least to start with.

Yes.  The Ada 95 Rationale includes two overview chapters, one
summarizing the differences between Ada 83 and Ada 95, and one
giving an overview of Ada 95 in its entirety.

: 4: Any other 'newbie advice'?

Play with the GNAT examples and edit them to try out new things
incrementally.

: 5: Anyone want any specific 'newbie perspectives'? You've already
:    gotten some.

Sure.  Just post it to comp.lang.ada, and you will be heard...

: Please don't flame me because of my address. I'm a lowly DRAM designer,
: and have nothing to do with the company I work for not backing Ada.

: Thanks,
: Dale Pontius
: (NOT speaking for IBM)

-Tucker Taft  stt@inmet.com
Intermetrics, Inc.




      parent reply	other threads:[~1995-03-29  0:00 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1995-03-27 18:27 GNAT newbie Dale Pontius
1995-03-29  0:00 ` John Howard
1995-03-29  0:00 ` Theodore Dennison
1995-03-29  0:00 ` Theodore Dennison
1995-03-29  0:00 ` Tucker Taft [this message]
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox