comp.lang.ada
 help / color / mirror / Atom feed
From: Richard Maine <maine@qnet.com>
Subject: Re: F9X twister & ADA (was: n-dim'l vectors)
Date: 2000/04/08
Date: 2000-04-08T00:00:00+00:00	[thread overview]
Message-ID: <m2og7kyy1c.fsf@vega.qnet.com> (raw)
In-Reply-To: 38EF6B75.DD12DD25@att.net

Dick Hendrickson <dick.hendrickson@att.net> writes:

> Here's what I'd try to do to modify the original F90 sample

[elided]

Not too different from what I'd have done.  Dick did the most
important thing, which was to put it in a module.

There are a few other things I'd probably do differently, but they are
smaller and are also definitely matters of personal style preferences.
I wouldn't say my style choice is better or worse - just different.
In particular...

I avoid the DIMENSION keyword, choosing a slightly more compact style.

I'd also have the "implicit none" at the module scope instead of in
the function (it gets inherited into the function).

And I don't usually use a result clause for a function, so take it off and
replace all instances of z by my_func.

Add appropriate comments and you'd then have pretty much the way I'd
have probably written this myself.  That ends up with (except for
the comments, which I won't bother with here)

    module  some_functions
      implicit none
    contains
      function my_func (x,y)
        integer, intent(in) :: x(:), y(:)
        integer :: my_func(size(x))
        z = x + y
        return
      end function my_func
    end module some_functions

The calling stuff is the same.

-- 
Richard Maine
maine@qnet.com




  reply	other threads:[~2000-04-08  0:00 UTC|newest]

Thread overview: 48+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <8cctts$ujr$1@nnrp1.deja.com>
     [not found] ` <38EA0440.1ECBC158@ncep.noaa.gov>
2000-04-06  0:00   ` F9X twister & ADA (was: n-dim'l vectors) bv
2000-04-06  0:00     ` Richard Maine
2000-04-07  0:00       ` Brian Rogoff
2000-04-08  0:00         ` Dick Hendrickson
2000-04-08  0:00           ` Richard Maine [this message]
2000-04-09  0:00             ` Gary Scott
2000-04-09  0:00               ` Richard Maine
2000-04-09  0:00           ` Geoff Bull
2000-04-09  0:00             ` Dick Hendrickson
2000-04-09  0:00               ` Robert Dewar
2000-04-09  0:00                 ` Gordon Sande
2000-04-09  0:00                   ` James Giles
2000-04-10  0:00                 ` tmoran
2000-04-15  0:00                 ` Aidan Skinner
2000-04-17  0:00                   ` Robert I. Eachus
2000-04-16  0:00                 ` Ken Garlington
2000-04-12  0:00               ` Robert I. Eachus
2000-04-10  0:00       ` bv
2000-04-10  0:00         ` James Van Buskirk
2000-04-11  0:00         ` James Giles
2000-04-11  0:00           ` Geoff Bull
2000-04-11  0:00             ` James Giles
2000-04-11  0:00               ` Larry Kilgallen
2000-04-11  0:00                 ` James Giles
2000-04-11  0:00                   ` Larry Kilgallen
2000-04-12  0:00                   ` Robert A Duff
2000-04-12  0:00               ` Geoff Bull
2000-04-12  0:00                 ` James Giles
2000-04-12  0:00                   ` Geoff Bull
2000-04-12  0:00                     ` James Giles
2000-04-12  0:00                       ` Geoff Bull
2000-04-12  0:00                         ` Marin D. Condic
2000-04-12  0:00                           ` James Giles
2000-04-12  0:00                           ` James Giles
2000-04-12  0:00                         ` James Giles
2000-04-13  0:00                           ` Geoff Bull
2000-04-13  0:00                             ` James Giles
2000-04-14  0:00                               ` Geoff Bull
2000-04-13  0:00                             ` Debugging (was: F9X twister & ADA) James Giles
2000-04-11  0:00           ` F9X twister & ADA (was: n-dim'l vectors) Dale Stanbrough
2000-04-11  0:00             ` James Giles
2000-04-12  0:00               ` Robert A Duff
2000-04-14  0:00           ` bv
2000-04-07  0:00     ` Paul van Delst
2000-04-10  0:00       ` bv
2000-04-07  0:00     ` Erik Edelmann
2000-04-07  0:00       ` Robert Dewar
2000-04-07  0:00         ` Erik Edelmann
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox