From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail From: "Jeffrey R. Carter" Newsgroups: comp.lang.ada Subject: Re: Instantiating package problems Date: Sun, 3 Jan 2016 15:39:34 -0700 Organization: Also freenews.netfront.net; news.tornevall.net; news.eternal-september.org Message-ID: References: <7dcd49f3-b04f-4ea3-b431-5c27f73b9afe@googlegroups.com> <425bc374-d508-4e5b-b9ba-09e8cbaaf237@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Injection-Date: Sun, 3 Jan 2016 22:36:57 -0000 (UTC) Injection-Info: mx02.eternal-september.org; posting-host="caa759af2a9c666aec02942f6fe5abd6"; logging-data="27237"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX188TVBtPh6I5AgPvSDybUbbcb+nGWzXTp4=" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.4.0 In-Reply-To: <425bc374-d508-4e5b-b9ba-09e8cbaaf237@googlegroups.com> Cancel-Lock: sha1:R/KFVupwHLd8cvjDkB4O6LGqxuM= X-Enigmail-Draft-Status: N1110 Xref: news.eternal-september.org comp.lang.ada:29003 Date: 2016-01-03T15:39:34-07:00 List-Id: 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