From: "Steven Deller" <deller@smsail.com>
Subject: RE: Child packages question
Date: Mon, 8 Apr 2002 22:54:50 -0400
Date: 2002-04-08T22:54:50-04:00 [thread overview]
Message-ID: <mailman.1018324623.16405.comp.lang.ada@ada.eu.org> (raw)
In-Reply-To: <3CB24F38.2D03C71A@myob.com>
Nice example.
The second commented item (that you want to uncomment and see a
complaint) should read:
-- Car.Engine.Pump_More_Gas ;
not
-- Car.Engine.Accelerate;
Of course a compiler will complain about either, but I believe the
germane complaint (regarding private package) would occur for the first.
Regards,
Steve
> -----Original Message-----
> From: comp.lang.ada-admin@ada.eu.org
> [mailto:comp.lang.ada-admin@ada.eu.org] On Behalf Of sk
> Sent: Monday, April 08, 2002 10:17 PM
> To: comp.lang.ada@ada.eu.org
> Subject: Re: Child packages question
>
>
> Hi,
>
> -----------------------------------------------------
> -- file1 : car.ads
> package Car is
>
> procedure Accelerate;
>
> end Car;
>
> -----------------------------------------------------
> -- file2 : car.ads
> with Car.Engine;
>
> package body Car is
>
> procedure Accelerate is
> begin
> Car.Engine.Pump_More_Gas;
> end Accelerate;
>
> end Car;
>
> -----------------------------------------------------
> -- file2 : car-engine.ads
> private package Car.Engine is
>
> procedure Pump_More_Gas;
>
> end Car.Engine;
>
> -----------------------------------------------------
> -- file2 : car-engine.adb
> package body Car.Engine is
>
> procedure Pump_More_Gas is
> begin
> null;
> end Pump_More_Gas;
>
> end Car.Engine;
>
> -----------------------------------------------------
> -- file2 : Mario_Andretti.adb
> with Car;
> --with Car.Engine;
>
> procedure Mario_Andretti is
>
> begin
> Car.Accelerate;
>
> -- Car.Engine.Accelerate;
>
> end Mario_Andretti;
> -----------------------------------------------------
>
> Try uncommenting :
> "with Car.Engine"
> "Car.Engine.Accelerate"
>
> Compiler should complain :-)
>
> --
> -------------------------------------
> -- Merge vertically for real address
> -------------------------------------
> s n p @ t . o
> k i e k c c m
> -------------------------------------
> _______________________________________________
> comp.lang.ada mailing list
> comp.lang.ada@ada.eu.org
> http://ada.eu.org/mailman/listinfo/comp.lang.ad> a
>
next parent reply other threads:[~2002-04-09 2:54 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <3CB24F38.2D03C71A@myob.com>
2002-04-09 2:54 ` Steven Deller [this message]
[not found] <000101c1df71$eb7d9920$2137e5c0@rational.com>
2002-04-09 3:22 ` Child packages question sk
2002-04-09 1:33 James Ross
2002-04-09 2:17 ` sk
2002-04-09 4:39 ` James Ross
2002-04-09 4:40 ` sk
2002-04-09 6:37 ` Ingo Marks
2002-04-09 3:17 ` Pat Rogers
2002-04-09 3:58 ` Randy Brukardt
2002-04-09 8:28 ` tmoran
2002-04-09 15:11 ` Ted Dennison
2002-04-10 23:02 ` Randy Brukardt
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox