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!news.eternal-september.org!.POSTED!not-for-mail From: Simon Wright Newsgroups: comp.lang.ada Subject: Re: How to write "Hello" to a text file without a line terminator Date: Sun, 14 Aug 2016 09:30:12 +0100 Organization: A noiseless patient Spider Message-ID: References: <2cc97e17-313e-44b8-b335-8d5e815e925a@googlegroups.com> <4c49991e-9001-464f-afbb-3fcbf78e5656@googlegroups.com> <41b076f1-66b0-4142-8b91-0e717b6176c2@googlegroups.com> <7dd84caf-d094-4498-a6f1-91e275f09346@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: mx02.eternal-september.org; posting-host="5267241106bfbad1cae7e8b738bf59f6"; logging-data="14289"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/x3tNFUrbffJ6fBXKqFp0EF36juS83a0k=" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (darwin) Cancel-Lock: sha1:Kh4kbmdwU3U+iAo8ODLRhFutrCo= sha1:AWjxOGW6kZwBSeRNd/ffGH4PO7A= Xref: news.eternal-september.org comp.lang.ada:31429 Date: 2016-08-14T09:30:12+01:00 List-Id: AdaMagica writes: > Am Samstag, 13. August 2016 20:03:51 UTC+2 schrieb Jeffrey R. Carter: >> $ ./str_seq_io >> 32 >> $ hd junk >> 00000000 06 00 00 00 00 00 00 00 61 62 63 64 65 66 |........abcdef| > ???? -- Letters 'A' through 'Z' are at positions 65 through 90 ???? 'hd' is (probably) Carter's alias for 'hexdump -C' - the values are in hex. And, those are letters 'a' .. 'z', not 'A' .. 'Z'. >> 0000000e > [...] > But what's 00000000 and 0000000e? The (hex) offsets within the file. > Obviously on your 64-bit machine, length is output in 64 bits, > although Integer has only 32. Come to think of it, what would the use case be for instantiating Sequential (or Direct) IO with an unconstrained type? they both have only procedural forms for Read, so how could you ever retrieve a value? GNAT has package Ada.Sequential_IO is pragma Compile_Time_Warning (Element_Type'Has_Access_Values, "Element_Type for Sequential_IO instance has access values"); pragma Compile_Time_Warning (Element_Type'Has_Tagged_Values, "Element_Type for Sequential_IO instance has tagged values"); so should we ask for GNAT to do similar with "not Element_Type'Constrained"? (use of 'Constrained with a type is a GNAT extension).