comp.lang.ada
 help / color / mirror / Atom feed
From: Simon Wright <simon@pushface.org>
Subject: Re: How to include shared code
Date: Thu, 19 Sep 2013 07:24:55 +0100
Date: 2013-09-19T07:24:55+01:00	[thread overview]
Message-ID: <lyhadh5nwo.fsf@pushface.org> (raw)
In-Reply-To: f46333c1-5d51-4c67-b17c-bd152fe9331c@googlegroups.com

Peter Brooks <peter.h.m.brooks@gmail.com> writes:

> On Thursday, 19 September 2013 02:17:52 UTC+2, Emanuel Berg  wrote:
>> 
>> Now, how can I extract that piece of code from both files, and put
>> it into another file, say, random_period.adb, and then "include"
>> it into each of the above files (that operate in isolation)?
>> 
> That's what .ads files are for - you specify your function (and
> everything else you need shared) in a package in a .ads file. Then the
> gnat make will find and incorporate it:
>
> http://blog.projectpolymath.org/ada-2012-tutorial_01/
>
> gives an example of what a .ads file looks like at the bottom.

The relevant chapter in "Ada 95: The Craft of Object-Oriented
Programming" is http://archive.adaic.com/docs/craft/html/ch04.htm#4.7
(NB, external references in this document won't work)


  reply	other threads:[~2013-09-19  6:24 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-19  0:17 How to include shared code Emanuel Berg
2013-09-19  5:31 ` Peter Brooks
2013-09-19  6:24   ` Simon Wright [this message]
2013-09-19  7:20 ` Dmitry A. Kazakov
replies disabled

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