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,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,8f01d35116e753b6 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.68.236.170 with SMTP id uv10mr15908005pbc.4.1332944730491; Wed, 28 Mar 2012 07:25:30 -0700 (PDT) Path: z9ni11549pbe.0!nntp.google.com!news2.google.com!news4.google.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Michael Moeller Newsgroups: comp.lang.ada Subject: Re: xor Date: Wed, 28 Mar 2012 16:23:12 +0100 Message-ID: References: <9t8mq9Fla4U1@mid.individual.net> <9t99r9F6e2U1@mid.individual.net> <4f72393e$0$6643$9b4e6d93@newsspool2.arcor-online.net> <4f7308a9$0$7625$9b4e6d93@newsspool1.arcor-online.net> Mime-Version: 1.0 X-Trace: individual.net XVf6upHbtqp8ZCXH0k2tTQm9oriLuGKSoJ8ysQX8PxRHVxk21c X-Orig-Path: kodiak1!mic2 Cancel-Lock: sha1:bG8rOW0Xro6lSrFVzddRV39Y844= X-X-Sender: mic2@kodiak1 In-Reply-To: <4f7308a9$0$7625$9b4e6d93@newsspool1.arcor-online.net> Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Date: 2012-03-28T16:23:12+01:00 List-Id: On Wed, 28 Mar 2012, Georg Bauhaus wrote: > On 28.03.12 14:18, Michael Moeller wrote: > >> While this example compiles without complaints it >> doesn't work with procedures declared in my package. How can I >> make Sequential_IO visible there? > > Instantiate Sequential_IO where you need it: > If the instance is needed in several packages, > one solution is to create the instance at library level > (for GNAT, read: in a file that only declares UB_IO). > Then, add a with clause for this instance (UB_IO) > everywhere you need visibility of UB_IO. > (This is what context clauses are about; the other > part of visibility is nesting.) > > -->8-- > with Package_Defining_UByte; > > package UB_IO is new Sequential_IO (Package_Defining_UByte.Ubyte); > --8<-- > > > with UB_IO; > package One is ... > > with UB_IO; > package Two is ... > > > >> Its a little strange, though, how dead easy coding concurrency >> on a Sun machine was recently while I'm not able to write out >> some silly bytes using the very same language. > > This is not unusual, I think, insofar as virtually every language > requires some effort when I/O is more than "print". Python, > Java, Ada, C, C++, they all have some frowned upon simple I/O procedures, > and then the real thing. The latter takes time getting used to. > > (A really good .NET programmer (C#) told me that, now that he > needed to rewrite some software in Java (after a company takeover), > he noticed that he didn't know the first things about formatting > numbers in Java... Of course, he knew about formatting in general > which made learning easier for him.) > Thanks again for your quick and competent answers. This works. I agree with you on I/O. I've seen many languages and most often I/O is pretty peculiar. I don't want to push your helpfulness to far, but I still don't know whether there is any means to determine the size of a file from within Ada other than using a C subroutine calling fstat. Regards, Michael