comp.lang.ada
 help / color / mirror / Atom feed
From: Niklas Holsti <niklas.holsti@tidorum.invalid>
Subject: Re: Ada and string literals
Date: Fri, 01 Feb 2013 11:03:38 +0200
Date: 2013-02-01T11:03:38+02:00	[thread overview]
Message-ID: <an1enaFjakbU1@mid.individual.net> (raw)
In-Reply-To: <c81d094d-bfdc-49e7-a6af-09db13c7f6f5@googlegroups.com>

On 13-02-01 02:54 , Shark8 wrote:
> On Wednesday, January 30, 2013 7:52:58 AM UTC-6, Niklas Holsti wrote:
>>
>>    -- The following does NOT work:
>>    ..
>>    is
>>       A, B : String;
>>    begin
>>       if Alpha then A := "James"; else A := "John"  ; end if;
>>       if Beta  then B := "Jill";  else B := "Jennie"; end if;
>>       Foo (A, B);
>>    ..
> 
> But it's unneeded in Ada 2012 -- use the following:
> Foo(
>   Param_1 => (if alpha then "James" else "John"),
>   Param_2 => (if beta then "Jill" else "Jennie")
> );

I guess you didn't read to the end of my post before replying.

Using Ada 2012 conditional expressions in the actual parameters works in
this simple example, but become cumbersome (e.g. because of duplicated
conditions and nested conditions) in more complex cases.

-- 
Niklas Holsti
Tidorum Ltd
niklas holsti tidorum fi
      .      @       .



  reply	other threads:[~2013-02-01  9:03 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-30  0:44 Ada and string literals codeallergy
2013-01-30  7:08 ` Niklas Holsti
2013-01-30 11:50   ` Mart van de Wege
2013-01-30 13:52     ` Niklas Holsti
2013-01-30 16:09       ` Adam Beneschan
2013-02-01  0:54       ` Shark8
2013-02-01  9:03         ` Niklas Holsti [this message]
2013-02-01 14:58           ` Shark8
2013-01-30 16:52     ` codeallergy
2013-01-30 17:19       ` Adam Beneschan
2013-01-30 20:02       ` Simon Wright
2013-01-30 20:19         ` Georg Bauhaus
2013-01-30 22:06       ` Robert A Duff
2013-01-30 22:10         ` Jeffrey Carter
2013-01-31  2:23           ` Robert A Duff
2013-01-31 15:49             ` Adam Beneschan
2013-01-31 22:24               ` Robert A Duff
2013-02-01 21:16       ` gautier_niouzes
2013-02-02  1:55       ` Stephen Leake
2013-02-02 14:30         ` Robert A Duff
2013-01-31  9:20     ` ake.ragnar.dahlgren
2013-01-30 16:20   ` Robert A Duff
2013-02-01 13:20     ` Stephen Leake
2013-02-01 14:49       ` Robert A Duff
2013-02-01 17:23       ` Dmitry A. Kazakov
2013-02-01 20:22         ` Robert A Duff
2013-02-01 22:03           ` Dmitry A. Kazakov
2013-01-30 22:54 ` codeallergy
2013-02-01  0:50 ` Shark8
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox