comp.lang.ada
 help / color / mirror / Atom feed
From: stt@henning.camb.inmet.com (Tucker Taft)
Subject: Re: Q: inlining
Date: 1996/06/17
Date: 1996-06-17T00:00:00+00:00	[thread overview]
Message-ID: <Dt4F36.1pG.0.-s@inmet.camb.inmet.com> (raw)
In-Reply-To: JSA.96Jun15185352@organon.com


Jon S Anthony (jsa@organon.com) wrote:
: In article <uvv20jh9j7p.fsf@chaq.informatik.uni-tuebingen.de> 
: Hannes Haug <Hannes.Haug@Student.Uni-Tuebingen.de> writes:

: > Hi,
: > 
: > I'm new to Ada and have a question on inlining. Does
: > inlining work across compilation units ? In C I can

: It can, yes.  I'm not sure if this is working in GNAT 3.05 yet or not.


: > write the function definition in a header file. How
: > can I do this in Ada ?

: In a package specification.  In fact, this is virtually a requirement
: to getting any "real" work done.

This answer could be confusing.  In C++, the function *definition*
usually needs to be in the header file for inlining to work.  In Ada,
only the function *declaration* is allowed in the package spec.  The
function body ("definition" in C parlance) goes in the package body, even
if there is a pragma inline on the function declaration.  The Ada compiler
needs to be smart enough to find the function body when it is needed.
Most Ada compilers do this (I don't know of any that don't, other
than older versions of GNAT).

: You might want to check out the following for online tutorials,
: references, a good Ada for C++ programmers paper, etc:

: http://lglwww.epfl.ch/Ada/

: Jon Anthony
: Organon Motives, Inc.
: 1 Williston Road, Suite 4
: Belmont, MA 02178

: 617.484.3383
: jsa@organon.com

-Tucker Taft   stt@inmet.com   http://www.inmet.com/~stt/
Intermetrics, Inc.  Cambridge, MA  USA




  parent reply	other threads:[~1996-06-17  0:00 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1996-06-15  0:00 Q: inlining Hannes Haug
1996-06-15  0:00 ` Jon S Anthony
1996-06-16  0:00   ` Robert Dewar
1996-06-17  0:00   ` Tucker Taft [this message]
1996-06-18  0:00   ` Jon S Anthony
1996-06-16  0:00 ` Hannes Haug
1996-06-18  0:00 ` Jon S Anthony
1996-06-19  0:00   ` Tucker Taft
1996-06-20  0:00     ` Robert Dewar
1996-06-20  0:00 ` Hannes Haug
1996-06-20  0:00   ` Robert Dewar
1996-06-24  0:00 ` Hannes Haug
replies disabled

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