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-Thread: 103376,de7dd126d6737f3a X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news4.google.com!feeder.news-service.com!newsfeed.straub-nv.de!noris.net!newsfeed.arcor.de!newsspool3.arcor-online.net!news.arcor.de.POSTED!not-for-mail From: "Dmitry A. Kazakov" Subject: Re: Callback in Ada Newsgroups: comp.lang.ada User-Agent: 40tude_Dialog/2.0.15.1 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Reply-To: mailbox@dmitry-kazakov.de Organization: cbb software GmbH References: <8lc2d0Fb6jU1@mid.individual.net> Date: Sat, 27 Nov 2010 11:11:26 +0100 Message-ID: NNTP-Posting-Date: 27 Nov 2010 11:11:23 CET NNTP-Posting-Host: ffc062bd.newsspool1.arcor-online.net X-Trace: DXC=RnN`14I2GWnj5k5aEF7ISmic==]BZ:afn4Fo<]lROoRa<`=YMgDjhgbjT0RSF^oPHl[6LHn;2LCVn[ On 27 Nov 2010 09:47:12 GMT, Georg Maubach wrote: > How would I do that in Ada? type Integer_Array is array (Positive range <>) of Integer; procedure Apply ( Action : not null access procedure (Value : in out Integer); To : in out Integer_Array ) is begin for Index in To'Range loop Action (To (Index)); end loop; end Apply; procedure Double (Value : in out Integer) is begin Value := Value * 2; end Double; Used as: List : Integer_Array := (1,2,3,4,5); begin Apply (Double'Access, List); -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de