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.2 required=5.0 tests=BAYES_00,FROM_WORDY, INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,fd3a5ba6349a6060 X-Google-Attributes: gid103376,public From: "Nick Roberts" Subject: Re: should I be interested in ada? Date: 1999/02/25 Message-ID: <7b2j2u$drp$1@plug.news.pipex.net>#1/1 X-Deja-AN: 448175705 References: <7a72e6$g55$1@probity.mcc.ac.uk> <36C93BB4.1429@ecs.soton.ac.uk> <7afc1o$3mi$2@plug.news.pipex.net> <7afttr$7v3$1@nnrp1.dejanews.com> <7aganu$qsc$1@plug.news.pipex.net> <36CC3AEA.59E2@lanl.gov> <7ai502$6an$1@nnrp1.dejanews.com> <36CD8DBA.237C@lanl.gov> <7akvao$j5t$2@plug.news.pipex.net> <36D1D862.41C6@lanl.gov> <7av53r$goc$2@plug.news.pipex.net> <36D33B65.446B@lanl.gov> X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3 Organization: UUNET WorldCom server (post doesn't reflect views of UUNET WorldCom) Newsgroups: comp.lang.ada Date: 1999-02-25T00:00:00+00:00 List-Id: William Clodius wrote in message <36D33B65.446B@lanl.gov>... |Ni |> Its true that the Ada code doesn't capture the same semantics - essentially |> that no component of Object will be assigned more than once (and they can be |> assigned in any order) - but I'm not sure that this will make any difference |> in practice (for a non-parallel target). | |The above "essentially" demphasizes my main point, that it also doesn't |capture the semantics that the assignment may involve only part of the |objects X and J. I apologise; it's not my intention to use rhetoric to defeat your example. In the case of the Reorder procedure example I gave, a part of X could be reordered simply by passing a part of it into the call, e.g.: Reorder(X(a..b),J); The domain of J could be restricted by the same method, and its range by introducing two new parameters to the procedure, e.g.: Reorder(X(a..b),J(a..b),a,b); Again, not neat, but workable. |In thinking about this further, one additional problem to me is the |decision to make this an explicit procedure. I would normally do this |only under circumstances that need not apply to this case, i.e., if I |were going to use it at multiple points in the code or if it were doing |a complicated task that is easilly summarized. Under those circumstances |I would want a well documented routine. Reorder by itself could mean the |equivalent of any of the following I used a procedural abstraction, because it seemed appropriate in this case. In cases where an abstraction would not be appropriate, in-line code could be used instead. |The isolation of the code in this way makes it more difficult to verify |that it has the semantics required in the context in which it is |currently used, and even if appropriate there, increases the chance that |it will be reused in inappropriate contexts. So, in these cases, the inline Ada code ends up being substantially longer than the Fortran. However, if you were to take a typical Fortran program, and translate it into Ada, would you end up with a program that was substantially bigger (more than two times, say)? Would have any really thorny problems in doing the translation? I would say "very unlikely" to both questions. I suppose it now falls to me to illustrate this with an example! :-) |William B. Clodius Phone: (505)-665-9370 |Los Alamos Nat. Lab., NIS-2 FAX: (505)-667-3815 |PO Box 1663, MS-C323 Group office: (505)-667-5776 |Los Alamos, NM 87545 Email: wclodius@lanl.gov ------------------------------------- Nick Roberts -------------------------------------