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=2.0 required=5.0 tests=BAYES_00,FORGED_MUA_MOZILLA, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,26e047a7a0709881 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.68.223.40 with SMTP id qr8mr17546220pbc.0.1341713402679; Sat, 07 Jul 2012 19:10:02 -0700 (PDT) Path: l9ni11086pbj.0!nntp.google.com!news2.google.com!news.glorb.com!gegeweb.org!aioe.org!.POSTED!not-for-mail From: "Nasser M. Abbasi" Newsgroups: comp.lang.ada Subject: Re: How to initialize a matrix of one column only? Date: Sat, 07 Jul 2012 21:09:56 -0500 Organization: Aioe.org NNTP Server Message-ID: References: Reply-To: nma@12000.org NNTP-Posting-Host: KdJUrTuvv3Zv/s8pPxNluw.user.speranza.aioe.org Mime-Version: 1.0 X-Complaints-To: abuse@aioe.org User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:13.0) Gecko/20120614 Thunderbird/13.0.1 X-Notice: Filtered by postfilter v. 0.8.2 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Date: 2012-07-07T21:09:56-05:00 List-Id: On 7/7/2012 8:47 PM, John B. Matthews wrote: .... >> I tried B:=(1=>9.0,2=>2.03=>-2.0); ... >> >> What is the correct syntax to use? > > According to 4.3.3 Array Aggregates, you need to use named notation for > a single component, otherwise "a single expression in parentheses is > interpreted as a parenthesized expression." > > B := ((1 => 9.0), > (1 => 2.0), > (1 => -2.0)); > > > Thanks John. I think I did browse some of these RM notes, but I either missed it or did not understand it (sometimes the RM writing is hard to understand for me). But the above is a good example of why Ada has the reputation of being too verbose. Compare the above to Matlab for example to make a matrix of one column B=[9 2 -2]' or Mathematica B={{9},{2},{-2}} But I guess on the other hand, one gets the strong typing as a payback for all this extra typing. So may be one can't complain too much. regards, --Nasser