comp.lang.ada
 help / color / mirror / Atom feed
From: "G.B." <rm-dash-bau-haus@dash.futureapps.de>
Subject: Re: Procedure defined in package body accessed by separate procedure
Date: Thu, 13 Feb 2014 14:58:33 +0100
Date: 2014-02-13T14:58:19+01:00	[thread overview]
Message-ID: <52fccf7b$0$6667$9b4e6d93@newsspool2.arcor-online.net> (raw)
In-Reply-To: <aae6105c-fb90-42f0-b87e-6d38122fd64c@googlegroups.com>

On 13.02.14 13:15, ashwath30jul77@gmail.com wrote:

> package body Greetings is
>
>     procedure Hello is separate;
>     procedure Goodbye is separate;
>     procedure proc_body is
>     begin
>        put_line("body");
>     end;
> end Greetings;
>
> Greetings-Hello.ada:
> ================================
> with text_io;
> use Text_IO;
> separate (Greetings)
>
> procedure Hello is
> begin
>     put_line("Hello");
>     Greetings.proc_body;--Compiler error here. Says proc_body is not declared in Greetings
> end;

Linearity of reading seems at work here: proc_body, in body
Greetings, appears after the line that says "Hello is
separate". Therefore, when that line is "evaluated", there
is no procedure proc_body (yet).
To resolve the issue, either put a specification of
procedure proc_body before "... Hello is separate", or put
the latter line after proc_body's definition.



  reply	other threads:[~2014-02-13 13:58 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-13 12:15 Procedure defined in package body accessed by separate procedure ashwath30jul77
2014-02-13 13:58 ` G.B. [this message]
2014-02-13 16:54   ` adambeneschan
2014-02-14  6:30     ` ashwath30jul77
2014-02-14  9:22       ` Simon Wright
2014-02-13 16:32 ` Dirk Heinrichs
2014-02-13 16:43   ` adambeneschan
2014-02-13 16:57     ` Dirk Heinrichs
2014-02-13 16:59       ` Dirk Heinrichs
replies disabled

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