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,345a8b767542016e X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-03-15 08:17:25 PST Newsgroups: comp.lang.ada Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news.uchicago.edu!newsswitch.lcs.mit.edu!newsfeed.cwix.com!nntp.abs.net!uunet!dca.uu.net!ash.uu.net!xyzzy!nntp From: Jeffrey Carter Subject: Re: memory leakages with Ada? X-Nntp-Posting-Host: e246420.msc.az.boeing.com Content-Type: text/plain; charset=us-ascii Message-ID: <3C9217EB.B74EDFC2@boeing.com> Sender: nntp@news.boeing.com (Boeing NNTP News Access) Content-Transfer-Encoding: 7bit Organization: The Boeing Company X-Accept-Language: en References: <3c90af1e@news.starhub.net.sg> Mime-Version: 1.0 Date: Fri, 15 Mar 2002 15:48:59 GMT X-Mailer: Mozilla 4.73 [en]C-CCK-MCD Boeing Kit (WinNT; U) Xref: archiver1.google.com comp.lang.ada:21291 Date: 2002-03-15T15:48:59+00:00 List-Id: Steve Doiel wrote: > > For example, if you want to read a block of data that is preceded by a count > that gives the amount of data, in Ada the code would be something like: > > nbBytes := GetNbBytes( dataSource ); > declare > dataBuffer : ByteBuffer( 1 .. nbBytes ); > begin > GetData( dataBuffer ); > end; No, Ada looks little like this. It looks much better: Num_Bytes := Get_Count (Data_Source); Read_Data : declare Data_Buffer : Byte_List (1 .. Num_Bytes); begin -- Read_Data Get_Data (Data => Data_Buffer); ... end Read_Data; -- Jeffrey Carter