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,2ebd9459a8ae4178 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news2.google.com!news.glorb.com!feeder.erje.net!feeder.news-service.com!aioe.org!.POSTED!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: Question: dynamic rename? Date: Sat, 3 Sep 2011 12:47:42 +0200 Organization: cbb software GmbH Message-ID: <1cemzkia3lrt.1hnh4wvoqj0j9$.dlg@40tude.net> References: <691c0c64-4b85-4465-9b12-5d56123b8d94@r8g2000prd.googlegroups.com> <1120rpf8n3otq.1r0ysnixm1bwt.dlg@40tude.net> Reply-To: mailbox@dmitry-kazakov.de NNTP-Posting-Host: 1bx/I0S3JwXnQn2WN4Rpfg.user.speranza.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Complaints-To: abuse@aioe.org User-Agent: 40tude_Dialog/2.0.15.1 X-Notice: Filtered by postfilter v. 0.8.2 Xref: g2news2.google.com comp.lang.ada:21807 Date: 2011-09-03T12:47:42+02:00 List-Id: On Sat, 03 Sep 2011 11:04:05 +0100, Simon Wright wrote: > "Dmitry A. Kazakov" writes: > >> On Fri, 2 Sep 2011 19:28:38 -0700 (PDT), Darkwing wrote: >> >>> Is there an Ada elegant way to do something like the following: >>> >>> signal : signal_type renames => >>> case configuration is >>> when one => signal_one; >>> when two => signal_two; >>> end case; >> >> Nested subprogram taking signal as an argument. > > I thought that, but what if signal_one, signal_two were variables and > you needed an lvalue? declare procedure Do_Things (Signal : in out Signal_Type) is begin ... end Do_Things; begin case Configuration is when one => Do_Things (Signal_one); when two => Do_Things (Signal_two); end case; ... ? -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de