comp.lang.ada
 help / color / mirror / Atom feed
* is everything child of Standard Package in Ada?
@ 1999-03-02  0:00 nabbasi
  1999-03-02  0:00 ` robert_dewar
  1999-03-02  0:00 ` Samuel Mize
  0 siblings, 2 replies; 6+ messages in thread
From: nabbasi @ 1999-03-02  0:00 UTC (permalink / raw)


hi,

is it implicit that every package in Ada is a 'child' of Standard package?

i.e. is package Ada a child of Standard package for example? 

(reason I ask, is that RM on page 259, shows Standard package as one level
over everything else. But if you look inside package Ada, it does not say
package Standard.Ada.etc..., just package Ada.etc...

thanks,
Nasser




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

* Re: is everything child of Standard Package in Ada?
  1999-03-02  0:00 is everything child of Standard Package in Ada? nabbasi
  1999-03-02  0:00 ` robert_dewar
@ 1999-03-02  0:00 ` Samuel Mize
  1999-03-03  0:00   ` Samuel Mize
  1999-03-05  0:00   ` Robert A Duff
  1 sibling, 2 replies; 6+ messages in thread
From: Samuel Mize @ 1999-03-02  0:00 UTC (permalink / raw)


nabbasi@pacbell.net wrote:
> hi,
> 
> is it implicit that every package in Ada is a 'child' of Standard package?
> 
> i.e. is package Ada a child of Standard package for example? 

Yes, see ARM 10.1.1(1).

However, it is a special case.  You don't need to say, for instance,
"Standard.Ada.Text_Io" and indeed you can't (at least on the compiler
I'm using at the moment).


> (reason I ask, is that RM on page 259, shows Standard package as one level
> over everything else.

Page numbers can vary between formats, it's often better to show section
and paragraph numbers, in this case: A(2).


Best,
Sam Mize

-- 
Samuel Mize -- smize@imagin.net (home email) -- Team Ada
Fight Spam: see http://www.cauce.org/ \\\ Smert Spamonam




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

* Re: is everything child of Standard Package in Ada?
  1999-03-02  0:00 is everything child of Standard Package in Ada? nabbasi
@ 1999-03-02  0:00 ` robert_dewar
  1999-03-03  0:00   ` Tucker Taft
  1999-03-02  0:00 ` Samuel Mize
  1 sibling, 1 reply; 6+ messages in thread
From: robert_dewar @ 1999-03-02  0:00 UTC (permalink / raw)


In article <7bgu62$l31@drn.newsguy.com>,
  nabbasi@pacbell.net wrote:
> hi,
>
> is it implicit that every package in Ada is a 'child' of
> Standard package?

No, the relationship is not that of a child package.

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    




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

* Re: is everything child of Standard Package in Ada?
  1999-03-02  0:00 ` Samuel Mize
@ 1999-03-03  0:00   ` Samuel Mize
  1999-03-05  0:00   ` Robert A Duff
  1 sibling, 0 replies; 6+ messages in thread
From: Samuel Mize @ 1999-03-03  0:00 UTC (permalink / raw)


Samuel Mize <smize@imagin.net> wrote:
> nabbasi@pacbell.net wrote:
>> hi,
>> 
>> is it implicit that every package in Ada is a 'child' of Standard package?
>> 
>> i.e. is package Ada a child of Standard package for example? 
> 
> Yes, see ARM 10.1.1(1).

Which will tell you nothing useful about this, but try here:

  ARM 10.1.1(1)

Which says (using caps for italics):

"Each library unit (except Standard) has a PARENT UNIT, which is a
library package or generic library package.  A library unit is a
CHILD of its parent unit.  The ROOT library units are the children
of the predefined library package Standard."

Also, 10.1.1(10):

"The PARENT DECLARATION of a library item (and of the library unit)
is the declaration denoted by the parent_unit_name, if any, of the
defining_program_unit_iname of the library_item.  If there is no
parent_unit_name, the parent declaration is the declaration of
Standard, the library_item is a root_library_item, and the library
unit (renaming)  is a ROOT library unit (renaming). ... The PARENT
UNIT of a library_item or library unit is the library unit declared
by its parent declaration."

And in 10.1.1(11):

"(Standard is an ancestor of every library unit.)"

Having said this, let me re-emphasize that Standard is a special
case, defined by the language.  You cannot refer to its children
with the child syntax, for example "Standard.Ada.Text_Io", although
you can refer to "Standard.Boolean" if you want to.

Best,
Sam Mize

-- 
Samuel Mize -- smize@imagin.net (home email) -- Team Ada
Fight Spam: see http://www.cauce.org/ \\\ Smert Spamonam




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

* Re: is everything child of Standard Package in Ada?
  1999-03-02  0:00 ` robert_dewar
@ 1999-03-03  0:00   ` Tucker Taft
  0 siblings, 0 replies; 6+ messages in thread
From: Tucker Taft @ 1999-03-03  0:00 UTC (permalink / raw)


robert_dewar@my-dejanews.com wrote:
: In article <7bgu62$l31@drn.newsguy.com>,
:   nabbasi@pacbell.net wrote:
: > hi,
: >
: > is it implicit that every package in Ada is a 'child' of
: > Standard package?

: No, the relationship is not that of a child package.

I suspect the questioner may have meant is every Ada package
a child of package Standard, in which case, the answer is:
"every 'root' Ada libary package is a child of package Standard."

Robert probably interpreted this question as "is every child of 
the package Ada also a child of package Standard?" and the
answer to that is: "no -- the children of package Ada are
grandchildren of package Standard."

To elaborate a bit...

Every library unit is a descendant of package Standard, and
is logically inside its declarative region.  The "root" library
units (like Ada itself, System, and Interfaces, plus those root units that
users choose to define themselves) are direct children of package Standard.
The direct children of these root packages in turn are effectively 
grandchildren of package Standard.

--
-Tucker Taft   stt@averstar.com   http://www.averstar.com/~stt/
Technical Director, Distributed IT Solutions  (www.averstar.com/tools)
AverStar (formerly Intermetrics, Inc.)   Burlington, MA  USA




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

* Re: is everything child of Standard Package in Ada?
  1999-03-02  0:00 ` Samuel Mize
  1999-03-03  0:00   ` Samuel Mize
@ 1999-03-05  0:00   ` Robert A Duff
  1 sibling, 0 replies; 6+ messages in thread
From: Robert A Duff @ 1999-03-05  0:00 UTC (permalink / raw)


Samuel Mize <smize@imagin.net> writes:

> However, it is a special case.  You don't need to say, for instance,
> "Standard.Ada.Text_Io" and indeed you can't (at least on the compiler
> I'm using at the moment).

This is true only in with_clauses; you must say "with Ada.Text_IO;" and
not "with Standard.Ada.Text_IO;".  In normal code, you can say things
like:

    Standard.Ada.Text_IO.Put_Line("Hello");

If you declare a library package called Standard, like this:

    package Standard is
    end Standard;

you will get a child of *the* Standard also called Standard;
that is, Standard.Standard.  That would be a pretty silly
thing to do, but it's legal.

- Bob
-- 
Change robert to bob to get my real email address.  Sorry.




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

end of thread, other threads:[~1999-03-05  0:00 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-03-02  0:00 is everything child of Standard Package in Ada? nabbasi
1999-03-02  0:00 ` robert_dewar
1999-03-03  0:00   ` Tucker Taft
1999-03-02  0:00 ` Samuel Mize
1999-03-03  0:00   ` Samuel Mize
1999-03-05  0:00   ` Robert A Duff

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