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=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,c360d0cfa1003043 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-10-07 10:07:30 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!logbridge.uoregon.edu!howland.erols.net!portc.blue.aol.com.MISMATCH!portc01.blue.aol.com!cyclone2.usenetserver.com!usenetserver.com!news-east.rr.com!news-west.rr.com!lsnws01.we.mediaone.net!typhoon.san.rr.com!not-for-mail Message-ID: <3BC08BD1.8F54D61B@san.rr.com> From: Darren New Organization: Boxes! X-Mailer: Mozilla 4.77 [en] (Windows NT 5.0; U) X-Accept-Language: en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Novice Ada Programmer Stumped By Simple Type Declaration! References: <3BBCB63C.96E484EA@san.rr.com> <3BBCD596.AF223388@san.rr.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Date: Sun, 07 Oct 2001 17:07:44 GMT NNTP-Posting-Host: 66.75.151.160 X-Complaints-To: abuse@rr.com X-Trace: typhoon.san.rr.com 1002474464 66.75.151.160 (Sun, 07 Oct 2001 10:07:44 PDT) NNTP-Posting-Date: Sun, 07 Oct 2001 10:07:44 PDT Xref: archiver1.google.com comp.lang.ada:13862 Date: 2001-10-07T17:07:44+00:00 List-Id: Simon Wright wrote: > > Darren New writes: > > > (Incidentally, this is for the unit-test code for a > > first-one-to-throw-away project, while I'm learning Ada, so the > > over-use of "use" isn't as bad as it might be.) > > > > Thanks! I can't believe I spent two days trying to figure that one > > out. > > Not to get at you, but you really should look at those two sentences > together! Wouldn't it have been more effective to kill the "use" and > accept the typing? That's what I'm saying. I tried that also. When I *did* use the fully-qualified name, I used the wrong one. The problem was that I had a nested child package (because it was an instantiated generic package) that I was forgetting to put on there. The routine I was trying to use was not in scope. GNAT was suggesting a different routine, or that my arguments were in the wrong order. It didn't matter whether I had any "use" or not, since I wasn't using the package I was trying to reference anyway. It was just one of those "the first time you do this, it'll take a day to figure out why you're getting an error." Kind of like in C when you use an uninitialized pointer, and when you put in printf's to see why it's dumping core, it stops dumping core. You can spend days on that the first time too. :-) > GNAT will often tell you that it would be able to resolve a reference > if only you put in a particular "use", best to qualify the name > properly IMHO .. The problem is when you start having packages like package Beep.Core.Profiles.Instantiations.Buffers, and you get calls like Beep.Core.Profile.Instantiations.Buffer.Queue(Beep.Core.Profiles.Instantiations.Frame_Buffer, Beep.Core.Control.In_Buffer.Next_Frame.all); I think a couple of "use" clauses there would help. Or a less heirarchical package mechanism or something. -- Darren New San Diego, CA, USA (PST). Cryptokeys on demand. Who is this Dr. Ibid anyway, and how does he know so much?