comp.lang.ada
 help / color / mirror / Atom feed
From: "Gary L. Scott" <scottg@flash.net>
Subject: Re: Fortran vs C++ vs. etc (has little to do with realtime anymore)
Date: 1997/09/23
Date: 1997-09-23T00:00:00+00:00	[thread overview]
Message-ID: <342891F8.BEDBF112@flash.net> (raw)
In-Reply-To: vi8oh5keyy1.fsf@drabble.fnal.gov


Oleg Krivosheev wrote:

> Hi, Rick
>
> rhawkins@iastate.edu (Rick Hawkins) writes:
>
> >
> >
> > In article <vi8k9ge42bw.fsf@drabble.fnal.gov>,
> > Oleg Krivosheev  <kriol@fnal.gov> wrote:
> >
> > >rhawkins@iastate.edu (Rick Hawkins) writes:
> >
> > >> yes!!!  learning c++ after not using c for ten years took some
> work.
> > >> Fortran after 12 years didn't; I could sit back donw and code.
> >
> > >well, if you're talking about F77, yes. FYI, there are already
> > >F90 and F95 here. I doubt you can program in F95 without
> > >learning - just as you did with C++.
> >
> > I'm using F90; It was Fortran IV on a pr1me and almost-f77 on tops
> 20
> > back then.
>
> well, that's exactly what i was asking about - there were NO
> F90/F95 twelve years ago ! If you're using F90 now, you learned
> it somehow. Either i misunderstood something or our claim
>
> "> >> Fortran after 12 years didn't; I could sit back donw and code."
>
> is wrong.

However, a very large percentage of Fortran 90 features (even some of
the new intrinsics) have been in some FORTRAN 77 compilers for
minicomputers as extensions since the late 70's/early 80's.  The main
exceptions being array syntax and "non-sequence" derived types.  So some
of us have had a long time to learn them.  I've used the following since
around 1981:

block do/end do (also for/end for, loop/end loop)
! comment
free form source (almost identical to the current standard)
variable # calling arguments (not F90/not keyword arguments/kinda messy)

"Purdue" bit manipulation intrinsics
direct physical memory address access ("Cray pointer" substitute?/not
F90)
; record separator
I'm sure others that I can't recall right now...

That's why I have such a hard time believing how long it took to get
some of them standardized and why some of them are still not in the
standard (but are rumored).

>
>
> > >cannot find max() in c++?
> >
> > I tried.  I looked.  I'm convinced it must be there, but . . .
> >
> > >couldn't figure how to write function with variable numbers
> > >of arguments?
> >
> > In the two books that I had, there was a single example, whihc
> managed
> > not to explain. I  wasn't just the issue of variable number of
> > arguments, but of arbitrarily large variable numbers
> > (i wanted my max()!  :)
>
> sorry, i have only min ;)
>
> well, try example below for min with
> arbitrary larger number of arguments. Hope it can help
>
> #include <assert.h>
> #include <stdio.h>
> #include <stdarg.h>
>
> double
> dmin( int nofargs, ... ) {
>
>   double res = 1.0e+38, arg;
>   int j;
>   va_list ap;
>
>   assert( nofargs > 1 );
>
>   va_start(ap, nofargs );
>
>   for( j = 0; j < nofargs; ++j ) {
>     arg=va_arg( ap, double );
>     if ( arg < res ) {
>       res = arg;
>     }
>   }
>   va_end(ap);
>   return res;
> }
>
> int
> main( void ) {
>
>   printf( "%e\n", dmin( 2, 1.0, 2.0 ) );
>
>   printf( "%e\n", dmin( 3, 0.0, 1.0, 2.0 ) );
>
>   printf( "%e\n", dmin( 5, 0.0, 1.0, 2.0, 7.0, -0.2 ) );
>
>   return 0;
> }
>
> > >there is something wrong with your C++ installation
> > >or with your C/C++ book.
> >
> > I assume it's the books; the compiler was either DEC cc or gcc; i
> forget
> > now.
>
> code above works fine with gcc on Sparc/Solaris 2.5 box
>
> regards
>
> OK







  reply	other threads:[~1997-09-23  0:00 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-09-13  0:00 Fortran vs C++ vs. etc (has little to do with realtime anymore) Dr. Krishnan Chittur
1997-09-15  0:00 ` Area Industrial y Electromec�nica
1997-09-16  0:00 ` Rick Hawkins
1997-09-18  0:00   ` Oleg Krivosheev
1997-09-19  0:00     ` Rick Hawkins
1997-09-23  0:00       ` Oleg Krivosheev
1997-09-23  0:00         ` Gary L. Scott [this message]
1997-09-24  0:00         ` Rick Hawkins
1997-09-24  0:00           ` Xingzeng Liu
1997-09-25  0:00         ` const
1997-09-25  0:00           ` Oleg Krivosheev
1997-09-16  0:00 ` Vanesch P.
1997-09-16  0:00   ` Jeffrey Templon
1997-09-16  0:00     ` Gary L. Scott
1997-09-17  0:00       ` Jenn-Ching Luo
1997-09-17  0:00         ` Gary L. Scott
     [not found] <199709070005.TAA23336@manifold.algebra.com>
     [not found] ` <5utbth$rdi@snews2.zippo.com>
     [not found]   ` <34131554.73F2310E@roda.roc.servtech.com>
     [not found]     ` <34157696.16620299@nntp.interaccess.com>
     [not found]       ` <JTV2J.97Sep9170655@cobra.cs.virginia.edu>
     [not found]         ` <3415CE44.3BD531@calfp.co.uk>
     [not found]           ` <341644F2.763D@BZZvnet.ibm.com>
1997-09-12  0:00             ` Jeffrey Templon
1997-09-13  0:00               ` Joseph M. O'Leary
1997-09-16  0:00                 ` James F Cornwall
replies disabled

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