From: "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de>
Subject: Re: Question: dynamic rename?
Date: Sat, 3 Sep 2011 12:47:42 +0200
Date: 2011-09-03T12:47:42+02:00 [thread overview]
Message-ID: <1cemzkia3lrt.1hnh4wvoqj0j9$.dlg@40tude.net> (raw)
In-Reply-To: m2fwkedjsa.fsf@pushface.org
On Sat, 03 Sep 2011 11:04:05 +0100, Simon Wright wrote:
> "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> 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
next prev parent reply other threads:[~2011-09-03 10:47 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-09-03 2:28 Question: dynamic rename? Darkwing
2011-09-03 8:03 ` Dmitry A. Kazakov
2011-09-03 10:04 ` Simon Wright
2011-09-03 10:47 ` Dmitry A. Kazakov [this message]
2011-09-03 12:27 ` ytomino
2011-09-03 13:22 ` Pascal Obry
2011-09-04 3:11 ` Darkwing
2011-09-04 8:43 ` Pascal Obry
2011-09-07 16:35 ` Anh Vo
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox