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=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f849b,b8d52151b7b306d2 X-Google-Attributes: gidf849b,public X-Google-Thread: 103376,a00006d3c4735d70 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2004-01-06 09:04:13 PST Path: archiver1.google.com!news2.google.com!newsfeed2.dallas1.level3.net!news.level3.com!zeus.visi.com!priapus.visi.com!orange.octanews.net!news.octanews.net!news-out.visi.com!petbe.visi.com!news2.telebyte.nl!newsfeed.stueberl.de!newsfeed01.sul.t-online.de!newsmm00.sul.t-online.com!t-online.de!news.t-online.com!not-for-mail From: Martin Krischik Newsgroups: comp.arch.embedded,comp.lang.ada Subject: Re: Certified C compilers for safety-critical embedded systems Followup-To: comp.arch.embedded,comp.lang.ada Date: Tue, 06 Jan 2004 13:45:58 +0100 Organization: AdaCL Message-ID: <1665674.ZrTUW4qaQq@linux1.krischik.com> References: <3fe00b82.90228601@News.CIS.DFN.DE> <5802069.JsgInS3tXa@linux1.krischik.com> <1072464162.325936@master.nyc.kbcfp.com> <1563361.SfB03k3vvC@linux1.krischik.com> <11LvOkBBXw7$EAJw@phaedsys.demon.co.uk> <3ff0687f.528387944@News.CIS.DFN.DE> <1086072.fFeiH4ICbz@linux1.krischik.com> <3ff18d4d.603356952@News.CIS.DFN.DE> <1731094.1f7Irsyk1h@linux1.krischik.com> <3ff1b8ef.614528516@News.CIS.DFN.DE> <3FF1E06D.A351CCB4@yahoo.com> <3ff20cc8.635997032@News.CIS.DFN.DE> <3ff9df16.30249104@News.CIS.DFN.DE> Reply-To: krischik@users.sourceforge.net Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7Bit X-Trace: news.t-online.com 1073408612 00 27826 C4A6G8lrQscXS8qX 040106 17:03:32 X-Complaints-To: usenet-abuse@t-online.de X-ID: ThrR0rZZQeWmmb5kGdFJZcwNxa616KQh7UXe461ygJZdXLiY6Vs2oC User-Agent: KNode/0.7.2 Xref: archiver1.google.com comp.arch.embedded:6859 comp.lang.ada:4146 Date: 2004-01-06T13:45:58+01:00 List-Id: Dave Hansen wrote: > On Wed, 31 Dec 2003 14:27:08 +0000 (UTC), Georg Bauhaus > wrote: > >>In comp.lang.ada Dave Hansen wrote: > > Note: I'm reading from comp.arch.embedded. Just so you know where I'm > coming from... > >>: while ( nextkey(&key) ) process(key); >>: > [... "&" operator signals "nextkey" might modify the value of the > parameter ...] >> >>Ada solution that addresses both & and the while(1) issue: >> >>procedure p is >> >> function next_key (key_filled: access Character) return Boolean is >> separate; >> >> procedure process (the_key: in out Character) is separate; >> >> >> key: aliased Character; >> >>begin >> >> while next_key (key'access) loop >> process(key); >> >> end loop; >> >>end p; > > Thanks. I like it, if I understand it. ;-) > > Is the "'access" tag (or whatever you call it) _required_ on the call Its called an attribute. All sort of things can have attributes. i.E. the Integer'Image () (function) attribute creates a String repesenting and Integer. > if a function is going to modify the parameter? I like it even better > if that's true. For functions yes, procedures however have in, out, in out and access. The difference between out and in out is interesting one. out means that the data comes back but no data is passed in. BZW: in, out and in out may or may not be implemented by the use of pointer. The compiler will do what is best. i.E. for a char it might be better to copy the char in and out instead passing a pointer. Especialy when a register is available for parameter passing. With Regards Martin -- mailto://krischik@users.sourceforge.net http://www.ada.krischik.com