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=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,dc1fff2721602dfa X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit X-Received: by 10.180.83.104 with SMTP id p8mr209018wiy.4.1359709420071; Fri, 01 Feb 2013 01:03:40 -0800 (PST) Path: bp2ni9671wib.1!nntp.google.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Niklas Holsti Newsgroups: comp.lang.ada Subject: Re: Ada and string literals Date: Fri, 01 Feb 2013 11:03:38 +0200 Organization: Tidorum Ltd Message-ID: References: <4978d638-a04b-4561-85e9-cf6620265af2@googlegroups.com> <86boc63n5d.fsf@gaheris.avalon.lan> Mime-Version: 1.0 X-Trace: individual.net Z5F/ySCfjX4OzVUOpHKMoAkSslwe+rC4CoWr6A0TBg+oCt5DVyXqF+m3ZGiQBXOt2/ Cancel-Lock: sha1:Kq/LHnQHUSK1yf/3otVrKKmnHsk= User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:17.0) Gecko/20130107 Thunderbird/17.0.2 In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Date: 2013-02-01T11:03:38+02:00 List-Id: 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 . @ .