comp.lang.ada
 help / color / mirror / Atom feed
* seperate compilation for protected objects
@ 2005-03-31 12:08 Andrew
  2005-03-31 12:15 ` Peter Hermann
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Andrew @ 2005-03-31 12:08 UTC (permalink / raw)


Hello,

I am trying to do seperate compilation with a protected object.

I have something similar to the following:

=== file tasks.ads ===
package Tasks is

    protected type Boob is
        . . .
    end Boob;
end Tasks;

=== file tasks.adb ===
package body Tasks is
    <blah>
    protected body Boob is seperate;
end Tasks;

I am using Gnat3.15p on FreeBSD Unix.
I get similar compilation messages to the below:
tasks.adb:<#>:<#>: all components must be declared in spec
...

If I put the declaration for the protected body in tasks.ads and remove
it from the package body then I get:
tasks.ads:<#>:<#>: proper body not allowed in package spec
tasks.ads:<#>:<#>: all components must be declared in spec
...

If I put the "is seperate" statement in both files I get:
tasks.adb:<#>:<#>: all components must be declared in spec


I don't get it.

Andrew




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

* Re: seperate compilation for protected objects
  2005-03-31 12:08 seperate compilation for protected objects Andrew
@ 2005-03-31 12:15 ` Peter Hermann
  2005-03-31 12:20   ` Andrew
  2005-03-31 12:22 ` Dr. Adrian Wrigley
  2005-03-31 13:44 ` Jean-Pierre Rosen
  2 siblings, 1 reply; 7+ messages in thread
From: Peter Hermann @ 2005-03-31 12:15 UTC (permalink / raw)


Andrew <andrew@carroll-tech.net> wrote:
> If I put the "is seperate" statement in both files I get:
> tasks.adb:<#>:<#>: all components must be declared in spec

this looks well like a lie  ;-)

-- 
--Peter Hermann(49)0711-685-3611 fax3758 ica2ph@csv.ica.uni-stuttgart.de
--Pfaffenwaldring 27 Raum 114, D-70569 Stuttgart Uni Computeranwendungen
--http://www.csv.ica.uni-stuttgart.de/homes/ph/
--Team Ada: "C'mon people let the world begin" (Paul McCartney)



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

* Re: seperate compilation for protected objects
  2005-03-31 12:15 ` Peter Hermann
@ 2005-03-31 12:20   ` Andrew
  0 siblings, 0 replies; 7+ messages in thread
From: Andrew @ 2005-03-31 12:20 UTC (permalink / raw)


A lie?

Who's lying, me or the compiler?

Andrew


Peter Hermann wrote:
> Andrew <andrew@carroll-tech.net> wrote:
> > If I put the "is seperate" statement in both files I get:
> > tasks.adb:<#>:<#>: all components must be declared in spec
>
> this looks well like a lie  ;-)
>
> --
> --Peter Hermann(49)0711-685-3611 fax3758
ica2ph@csv.ica.uni-stuttgart.de
> --Pfaffenwaldring 27 Raum 114, D-70569 Stuttgart Uni
Computeranwendungen
> --http://www.csv.ica.uni-stuttgart.de/homes/ph/
> --Team Ada: "C'mon people let the world begin" (Paul McCartney)




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

* Re: seperate compilation for protected objects
  2005-03-31 12:08 seperate compilation for protected objects Andrew
  2005-03-31 12:15 ` Peter Hermann
@ 2005-03-31 12:22 ` Dr. Adrian Wrigley
  2005-03-31 12:29   ` Andrew
  2005-03-31 13:44 ` Jean-Pierre Rosen
  2 siblings, 1 reply; 7+ messages in thread
From: Dr. Adrian Wrigley @ 2005-03-31 12:22 UTC (permalink / raw)


On Thu, 31 Mar 2005 04:08:25 -0800, Andrew wrote:

> Hello,
> 
> I am trying to do seperate compilation with a protected object.
> 
> I have something similar to the following:
> 
> === file tasks.ads ===
> package Tasks is
> 
>     protected type Boob is
>         . . .
>     end Boob;
> end Tasks;
> 
> === file tasks.adb ===
> package body Tasks is
>     <blah>
>     protected body Boob is seperate;
> end Tasks;

I hope you spell it *separate* in the actual code!
-- 
Adrian




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

* Re: seperate compilation for protected objects
  2005-03-31 12:22 ` Dr. Adrian Wrigley
@ 2005-03-31 12:29   ` Andrew
  0 siblings, 0 replies; 7+ messages in thread
From: Andrew @ 2005-03-31 12:29 UTC (permalink / raw)


:-)
Now I get it.




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

* Re: seperate compilation for protected objects
  2005-03-31 12:08 seperate compilation for protected objects Andrew
  2005-03-31 12:15 ` Peter Hermann
  2005-03-31 12:22 ` Dr. Adrian Wrigley
@ 2005-03-31 13:44 ` Jean-Pierre Rosen
  2005-04-01  8:25   ` Andrew
  2 siblings, 1 reply; 7+ messages in thread
From: Jean-Pierre Rosen @ 2005-03-31 13:44 UTC (permalink / raw)


Andrew a �crit :
> Hello,
> 
> I am trying to do seperate compilation with a protected object.
> 
> I have something similar to the following:
> 
> === file tasks.ads ===
> package Tasks is
> 
>     protected type Boob is
>         . . .
>     end Boob;
> end Tasks;
> 
> === file tasks.adb ===
> package body Tasks is
>     <blah>
>     protected body Boob is seperate;
> end Tasks;
> 
> I am using Gnat3.15p on FreeBSD Unix.
> I get similar compilation messages to the below:
> tasks.adb:<#>:<#>: all components must be declared in spec
> ...
> 
A wild guess, since you didn't show the body:
Didn't you declare components in the body? i.e.

protected body Boob is
     X : integer; -- Not allowed
     ....
end Boob;

Remember that a protected object is actually more like a record than a 
package; it has no variables, only components (like record components), 
and they are not allowed in the body.

Presumably, this has nothing to do with separate compilation...

-- 
---------------------------------------------------------
            J-P. Rosen (rosen@adalog.fr)
Visit Adalog's web site at http://www.adalog.fr



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

* Re: seperate compilation for protected objects
  2005-03-31 13:44 ` Jean-Pierre Rosen
@ 2005-04-01  8:25   ` Andrew
  0 siblings, 0 replies; 7+ messages in thread
From: Andrew @ 2005-04-01  8:25 UTC (permalink / raw)


Thanks Jean-Pierre.  The problem was that I spelled separate wrong.
Once I corrected it everything went well.

Jean-Pierre Rosen wrote:
> Andrew a écrit :
> > Hello,
> >
> > I am trying to do seperate compilation with a protected object.
> >
> > I have something similar to the following:
> >
> > === file tasks.ads ===
> > package Tasks is
> >
> >     protected type Boob is
> >         . . .
> >     end Boob;
> > end Tasks;
> >
> > === file tasks.adb ===
> > package body Tasks is
> >     <blah>
> >     protected body Boob is seperate;
> > end Tasks;
> >
> > I am using Gnat3.15p on FreeBSD Unix.
> > I get similar compilation messages to the below:
> > tasks.adb:<#>:<#>: all components must be declared in spec
> > ...
> >
> A wild guess, since you didn't show the body:
> Didn't you declare components in the body? i.e.
>
> protected body Boob is
>      X : integer; -- Not allowed
>      ....
> end Boob;
>
> Remember that a protected object is actually more like a record than
a
> package; it has no variables, only components (like record
components),
> and they are not allowed in the body.
>
> Presumably, this has nothing to do with separate compilation...
>
> --
> ---------------------------------------------------------
>             J-P. Rosen (rosen@adalog.fr)
> Visit Adalog's web site at http://www.adalog.fr




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

end of thread, other threads:[~2005-04-01  8:25 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-03-31 12:08 seperate compilation for protected objects Andrew
2005-03-31 12:15 ` Peter Hermann
2005-03-31 12:20   ` Andrew
2005-03-31 12:22 ` Dr. Adrian Wrigley
2005-03-31 12:29   ` Andrew
2005-03-31 13:44 ` Jean-Pierre Rosen
2005-04-01  8:25   ` Andrew

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