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,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,c4cb2c432feebd9d X-Google-Thread: 1094ba,c4cb2c432feebd9d X-Google-Attributes: gid103376,gid1094ba,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news2.google.com!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!wn14feed!worldnet.att.net!bgtnsc04-news.ops.worldnet.att.net.POSTED!b680011b!not-for-mail From: Dick Hendrickson User-Agent: Mozilla/5.0 (Windows; U; Win98; en-US; rv:1.4) Gecko/20030624 Netscape/7.1 (ax) X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: comp.lang.ada,comp.lang.fortran Subject: Re: Ada vs Fortran for scientific applications References: <0ugu4e.4i7.ln@hunter.axlog.fr> In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Message-ID: NNTP-Posting-Host: ce8cf46dccc916cbeba24b34bb8673d0 X-Complaints-To: abuse@worldnet.att.net X-Trace: bgtnsc04-news.ops.worldnet.att.net 1148416398 ce8cf46dccc916cbeba24b34bb8673d0 (Tue, 23 May 2006 20:33:18 GMT) NNTP-Posting-Date: Tue, 23 May 2006 20:33:18 GMT Organization: AT&T Worldnet Date: Tue, 23 May 2006 20:33:18 GMT Xref: g2news2.google.com comp.lang.ada:4386 comp.lang.fortran:10150 Date: 2006-05-23T20:33:18+00:00 List-Id: Dmitry A. Kazakov wrote: > On Tue, 23 May 2006 17:09:03 GMT, Dick Hendrickson wrote: > > >>Jean-Pierre Rosen wrote: > > >>>Is it possible in Fortran to define three *incompatible* types Length, >>>Time, and Speed, and define a "/" operator between Length and Time that >>>returns Speed? >> >>Yes, it's possible. There was a long thread inb c.l.f a >>year or two ago abou this. It's a bit of a pain in the butt >>to cover all the cases. Is E = m*c**2 the same as E=m*c*c? > > > Hmm, where is any problem? As I remember 2 is integer in Fortran. I hope it > can distinguish signatures ** : R x I -> R and ** : R x R -> R. Or do you > mean a geometrical explosion of variants? > > I was thinking of the geometric explosion. You'd need routines to do (mass) times (velocity squared), (velocity) times (velocity), (mass) times (velocity), and (mass*velocity) * velocity. And intermediate types to hold the partial answers. You probably don't want to say E = momentum*velocity. But that's what you'd get if you write it as m*c*c. Straightforward to cover all of this, but just a ton of cases.. Dick Hendrickson