comp.lang.ada
 help / color / mirror / Atom feed
From: "Jeffrey R. Carter" <spam.jrcarter.not@spam.not.acm.org>
Subject: Re: Instantiating package problems
Date: Sun, 3 Jan 2016 15:39:34 -0700
Date: 2016-01-03T15:39:34-07:00	[thread overview]
Message-ID: <n6c7q7$qj5$1@dont-email.me> (raw)
In-Reply-To: <425bc374-d508-4e5b-b9ba-09e8cbaaf237@googlegroups.com>

On 01/03/2016 02:27 PM, Andrew Shvets wrote:
> 
> Ok, I see, I think.  I suppose a better analogy is how in C you use #include
> "Some_File.h" and all of the contents of that file just come in and can be
> used readily, yes?

Sort of. File inclusion is a clumsy process and makes everything equally
visible, so you end up with this.h having things named this_name so it won't
conflict with things named name from other headers. Ada's with only makes the
pkg directly visible, so you have to use dotted notation to references
declarations within the pkg.

You can make declarations within a pkg directly visible with a use clause. There
are times when it's a good idea to use "use", and times when it isn't. I
recommend that beginners avoid it completely.

> I'm still a little bit lost on the below example: 
> https://en.wikibooks.org/wiki/Ada_Programming/Object_Orientation#Derived_types

I recommend you avoid type extension until you understand the basics of the
language better. For experienced developers, I recommend /Ada Distilled/,
available from

http://www.adaic.org/learn/materials/

(directly from

http://www.adaic.org/wp-content/uploads/2010/05/Ada-Distilled-24-January-2011-Ada-2005-Version.pdf)

(I actually recommend that you avoid programming by extension completely, but if
you're going to do it, you should understand the language basics first, and
little is more basic about Ada than pkgs.)

-- 
Jeff Carter
"Who wears beige to a bank robbery?"
Take the Money and Run
144


  reply	other threads:[~2016-01-03 22:39 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-03 18:40 Instantiating package problems Andrew Shvets
2016-01-03 20:27 ` Georg Bauhaus
2016-01-03 21:21   ` Andrew Shvets
2016-01-03 21:04 ` Jeffrey R. Carter
2016-01-03 21:27   ` Andrew Shvets
2016-01-03 22:39     ` Jeffrey R. Carter [this message]
2016-01-03 22:08 ` Bob Duff
2016-01-04  0:07   ` Andrew Shvets
2016-01-04  0:30     ` Andrew Shvets
2016-01-04 13:43       ` G.B.
2016-01-04 14:23       ` Brian Drummond
2016-01-04 20:49     ` Anh Vo
2016-01-04 21:10       ` Dmitry A. Kazakov
2016-01-04 22:39         ` Anh Vo
2016-01-05  1:42           ` Anh Vo
2016-01-05  7:35           ` Dmitry A. Kazakov
2016-01-06  2:46       ` Andrew Shvets
2016-01-06  8:53         ` Dmitry A. Kazakov
2016-01-06  3:30       ` Andrew Shvets
2016-01-06  4:51         ` Anh Vo
2016-01-06  4:54           ` Anh Vo
2016-01-06  5:00           ` Andrew Shvets
2016-01-06  5:07             ` Anh Vo
2016-01-07  4:41               ` Andrew Shvets
2016-01-07  5:41                 ` Anh Vo
2016-01-09 20:14                   ` Andrew Shvets
2016-01-10 19:43                     ` Andrew Shvets
2016-01-10 21:38                       ` Jeffrey R. Carter
2016-01-10 21:50                       ` Georg Bauhaus
2016-01-10 21:58                         ` Andrew Shvets
2016-01-06 13:07             ` G.B.
2016-01-07  4:42               ` Andrew Shvets
2016-01-06 14:25           ` Bob Duff
2016-01-06 23:48             ` Anh Vo
replies disabled

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