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.4 required=5.0 tests=BAYES_00,FORGED_MUA_MOZILLA autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,32d9aa9d79729b31 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII Received: by 10.68.223.40 with SMTP id qr8mr12383327pbc.0.1340610891333; Mon, 25 Jun 2012 00:54:51 -0700 (PDT) Path: l9ni17442pbj.0!nntp.google.com!news1.google.com!goblin1!goblin.stu.neva.ru!eternal-september.org!feeder.eternal-september.org!mx04.eternal-september.org!.POSTED!not-for-mail From: "J-P. Rosen" Newsgroups: comp.lang.ada Subject: Re: Any easy/build-in construct to extract submatrices from larger matrix? Date: Mon, 25 Jun 2012 09:54:49 +0200 Organization: A noiseless patient Spider Message-ID: References: <1xzo3825h9yt7$.45flobqwlel6.dlg@40tude.net> Mime-Version: 1.0 Injection-Date: Mon, 25 Jun 2012 07:54:50 +0000 (UTC) Injection-Info: mx04.eternal-september.org; posting-host="2pHdOENru/W0SOIejymqlA"; logging-data="20013"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18UTFR00PkBrPcAdPtcAI9A" User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:13.0) Gecko/20120614 Thunderbird/13.0.1 In-Reply-To: Cancel-Lock: sha1:7PI0w0f2BhxrSzptaxmX46FTyCc= X-Enigmail-Version: 1.4.2 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit Date: 2012-06-25T09:54:49+02:00 List-Id: Le 25/06/2012 08:32, Nasser M. Abbasi a �crit : > Ada is nice as it strongly typed and catches common errors. But > it is not as 'expressive' I am afraid as I'd like for this > sort of thing. > > In Mathematica for example, I do this whole operation in one line: > > --------------------------- > Table[ReplacePart[A,{{i},{i,_},{_,j}}:>Sequence[]],{i,nRow},{j,nCol}]; > --------------------------- > > That is all. This generates all submatrices from A as needed > in this problem :) > > I've been learning Mathematica, and I find functional programming > really powerful vs imperative programming, but it needs much more > time getting used to. Right. Now talk about readability... Ada is for long-lived programs, and places readability over writability. There is also a need for Kleenex programs, where conciseness is a quality (APL is an extreme example). Different needs, different solutions. -- J-P. Rosen Adalog 2 rue du Docteur Lombard, 92441 Issy-les-Moulineaux CEDEX Tel: +33 1 45 29 21 52, Fax: +33 1 45 29 25 00 http://www.adalog.fr