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: 103376,703c4f68db81387d X-Google-Thread: 109fba,703c4f68db81387d X-Google-Thread: 115aec,703c4f68db81387d X-Google-Thread: f43e6,703c4f68db81387d X-Google-Attributes: gid103376,gid109fba,gid115aec,gidf43e6,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news1.google.com!news.maxwell.syr.edu!nntp.abs.net!ash.uu.net!newsfd02.forthnet.gr!not-for-mail From: Ioannis Vranos Newsgroups: comp.lang.ada,comp.lang.c++,comp.realtime,comp.software-eng Subject: Re: [OT] Re: Teaching new tricks to an old dog (C++ -->Ada) Date: Sun, 06 Mar 2005 02:01:11 +0200 Organization: FORTHnet S.A., Atthidon 4, GR-17671 Kalithea, Greece, Tel: +30 2109559000, Fax: +30 2109559333, url: http://www.forthnet.gr Message-ID: <1110067277.116578@athnrd02> References: <4229bad9$0$1019$afc38c87@news.optusnet.com.au> <1110032222.447846.167060@g14g2000cwa.googlegroups.com> <871xau9nlh.fsf@insalien.org> <3SjWd.103128$Vf.3969241@news000.worldonline.dk> <87r7iu85lf.fsf@insalien.org> <87is4598pm.fsf@insalien.org> <1110054476.533590@athnrd02> <1110059861.560004@athnrd02> <87wtsl7jts.fsf@insalien.org> NNTP-Posting-Host: athnrd02.forthnet.gr Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: athprx02.forthnet.gr 1110067277 797 193.92.150.73 (6 Mar 2005 00:01:17 GMT) X-Complaints-To: abuse@forthnet.gr NNTP-Posting-Date: Sun, 6 Mar 2005 00:01:17 +0000 (UTC) User-Agent: Mozilla Thunderbird 1.0 (Windows/20041206) X-Accept-Language: en-us, en In-Reply-To: <87wtsl7jts.fsf@insalien.org> Cache-Post-Path: newsfd02!unknown@ppp36-adsl-149.ath.forthnet.gr Xref: g2news1.google.com comp.lang.ada:8697 comp.lang.c++:44247 comp.realtime:981 comp.software-eng:4512 Date: 2005-03-06T02:01:11+02:00 List-Id: Ludovic Brenta wrote: > in Ada, you would use an overlaid array of characters, like this: > > with Ada.Strings.Unbounded; > with Ada.Text_IO; > procedure Unsafe_Proc is > type Some_Class is record > S : Ada.Strings.Unbounded.Unbounded_String; > end record; > > Obj : aliased Some_Class := > (S => Ada.Strings.Unbounded.To_Unbounded_String > ("This is a text message")); > > Obj_As_String : String (1 .. Obj'Size / System.Storage_Unit); > for Obj_As_String'Address use Obj'Address; > begin > for J in Obj_As_String'Range loop > Ada.Text_IO.Put_Line > (Integer'Image (Character'Pos (Obj_As_String (J))) & > " " & > Obj_As_String (J)); > end loop; > end Unsafe_Proc; May you provide the output of the code? Because I can not understand much by itself. Can Ada display the decimal value of each byte that consists an object of a user-defined type, along with the bit values of these bytes? > Then I am not interested entrusting my life to your software. I wouldn't use low-level unsafe facilities for safety-critical situations but types which have checks all over the place and RAII. -- Ioannis Vranos http://www23.brinkster.com/noicys