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-Thread: a07f3367d7,c19e8df8a75221d0 X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news1.google.com!npeer01.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!cyclone1.gnilink.net!gnilink.net!newsfeed3.dallas1.level3.net!newsfeed2.dallas1.level3.net!news.level3.com!newsfeed-00.mathworks.com!nntp.TheWorld.com!not-for-mail From: Robert A Duff Newsgroups: comp.lang.ada Subject: Re: Q: Line_IO Date: Mon, 31 Aug 2009 18:51:49 -0400 Organization: The World Public Access UNIX, Brookline, MA Message-ID: References: <4a9b045a$0$31875$9b4e6d93@newsspool3.arcor-online.net> <1a4usf20z4mxa.1vct95fmrcs6h.dlg@40tude.net> NNTP-Posting-Host: shell01.theworld.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: pcls6.std.com 1251759110 22870 192.74.137.71 (31 Aug 2009 22:51:50 GMT) X-Complaints-To: abuse@TheWorld.com NNTP-Posting-Date: Mon, 31 Aug 2009 22:51:50 +0000 (UTC) User-Agent: Gnus/5.1008 (Gnus v5.10.8) Emacs/21.3 (irix) Cancel-Lock: sha1:KWQ7O/zPV5G0yYSYxW67C2EWnjI= Xref: g2news2.google.com comp.lang.ada:8079 Date: 2009-08-31T18:51:49-04:00 List-Id: "Dmitry A. Kazakov" writes: > Then there is a crazy way to convert congruent types without > Unchecked_Conversion. I cannot tell whether it is actually faster: > > procedure Print (Item : String) is > subtype Index is Stream_Element_Offset range 1..Item'Length; > subtype XBytes is Stream_Element_Array (Index); > Alias : XBytes; > for Alias'Address use Item'Address; > begin > Stream_IO.Write (Stdout, Alias); > ... > > P.S. The superimposed object shall not have initializers. If it has default initialization, you can suppress it using: pragma Import (Ada, Alias); See 13.3(12.c) and B.1(38,38.a). - Bob