comp.lang.ada
 help / color / mirror / Atom feed
* Re: DEC Ada and packages
@ 2002-02-07  5:59 Gautier Write-only-address
  2002-02-07 18:19 ` Zane H. Healy
  0 siblings, 1 reply; 12+ messages in thread
From: Gautier Write-only-address @ 2002-02-07  5:59 UTC (permalink / raw)


Hello!

In your powers.ada you have the "code" (the body), but
the "interface" (the specification) for using Powers
is missing.

Before "package body...", you may want to add:

---
package Powers is
        function Square (Arg: Integer) return Integer;
        function Cube (Arg: Integer) return Integer;
end Powers;
---

Then it should compile fine.

HTH
_________________________________________________________
Gautier  --  http://www.mysunrise.ch/users/gdm/gsoft.htm

NB: For a direct answer, address on the Web site!

_________________________________________________________________
MSN Photos is the easiest way to share and print your photos: 
http://photos.msn.com/support/worldwide.aspx




^ permalink raw reply	[flat|nested] 12+ messages in thread
* DEC Ada and packages
@ 2002-02-07  4:44 Zane H. Healy
  2002-02-07 13:44 ` Charlie McCutcheon
  0 siblings, 1 reply; 12+ messages in thread
From: Zane H. Healy @ 2002-02-07  4:44 UTC (permalink / raw)


I'm trying to teach myself Ada using DEC Ada on OpenVMS.  I've currently run
into a bit of a problem.  How on earth do you deal with Packages?  I've been
reading through the DEC Ada manuals and can't find anything.

As I understand it I should be able to put have a file 'powers.ada' have
something like the following in it (taken from an excellent tutorial I found
online):

package body Powers is
        function Square (Arg: Integer) return Integer is
        begin
                return Arg * Arg;
        end Square;

        function Cube (Arg: Integer) return Integer is
        begin
                return Arg * Square(Arg);
        end Cube;
end Powers;

Then call it from another file with a Proceedure.

However, I end up with the following results:

$ acs
ACS> load powers
%ACS-I-CL_COMPILING, Invoking the Compaq Ada compiler
ACS> compile powers
1 obsolete unit

%ACS-I-CL_COMPILING, Invoking the Compaq Ada compiler

    4   package body Powers is
........1
%ADAC-E-CL_SPENOTFOU, (1) Specification for Powers not found in library
at line number 4 in file MONK$DKB500:[HEALYZH.WORK]POWERS.ADA;4
%ADAC-E-ERRRECOMPILE, Errors recompiling package body Powers in file 
        MONK$DKB500:[HEALYZH.WORK]POWERS.ADA;4
%ADAC-E-ENDDIAGS, Ada compilation completed with 1 diagnostic

1 unit compiled in 00:00:00.14

%ACS-E-CL_ERRDURCOM, Errors during compilations
ACS> load play
%ACS-I-CL_COMPILING, Invoking the Compaq Ada compiler
ACS> compile play
%ACS-E-CL_UNKREFUNI, PLAY depends on unit POWERS, which is not in the
library
ACS> 

So how on earth do I get POWERS into the Library?  I'm sure I'm missing
something obvious, but what?

			Zane



^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2002-02-16  2:08 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-02-07  5:59 DEC Ada and packages Gautier Write-only-address
2002-02-07 18:19 ` Zane H. Healy
  -- strict thread matches above, loose matches on Subject: below --
2002-02-07  4:44 Zane H. Healy
2002-02-07 13:44 ` Charlie McCutcheon
2002-02-07 18:34   ` Zane H. Healy
2002-02-07 20:52     ` Marin David Condic
2002-02-07 21:29   ` Jeffrey Carter
2002-02-15 13:25     ` Charlie McCutcheon
2002-02-15 13:28       ` Ed Falis
2002-02-15 17:33       ` Jeffrey Carter
2002-02-16  1:45     ` Robert Dewar
2002-02-16  2:08       ` Jeffrey Carter

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