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,26aa6d7095c151 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-10-22 00:57:51 PST Message-ID: <3DB50455.E7964582@lml.ls.fi.upm.es> Date: Tue, 22 Oct 2002 09:55:01 +0200 From: Manuel Collado X-Mailer: Mozilla 4.75 [en] (WinNT; U) X-Accept-Language: en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Porting from Modula-2 to Ada References: <3DAFC542.152C0EE0@lml.ls.fi.upm.es> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit NNTP-Posting-Host: 138.100.10.20 X-Trace: 22 Oct 2002 09:52:11 +0100, 138.100.10.20 Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!bloom-beacon.mit.edu!news-out.cwix.com!newsfeed.cwix.com!newsfeed.icl.net!newsfeed.fjserv.net!news.tele.dk!news.tele.dk!small.news.tele.dk!news-ge.switch.ch!news.rediris.es!news-2.rediris.es!138.100.251.9.MISMATCH!news.upm.es!138.100.10.20 Xref: archiver1.google.com comp.lang.ada:30018 Date: 2002-10-22T09:55:01+02:00 List-Id: Manuel Collado wrote: > [snip] > Al present we are looking for ways to manage memory and binary files as > arrays of bytes. The trouble is that Modula-2 allows the use of relaxed > ARRAY OF BYTE subprogram formal parameters, that are compatible with > actual parameters of any type. Example: > [snip] > So far, my only porting scheme is to replace ARRAY OF BYTE parameters by > the pair (address, size), as follows: > > procedure Xxx (Raw_Address: System.Address; Raw_Size: Integer) ... > > Num: Integer; > ... > Xxx (Num'Address, Num'Size); > ... Thanks to all who respond. After considering the suggestions, I think I'll keep the initial proposed scheme. It doesn't follow the Ada programming style, but is straightforward. And in some cases it can be reduced in fact to passing the address, because the size is already an explicit parameter in some procedures. Thanks again, -- To reply by e-mail, please remove the extra dot in the given address: m.collado -> mcollado