Re: A question on Newton's Method



beliavsky@xxxxxxx wrote:
>> What happens if you allocate an array and then return it as the
>> result of a function?
>
> Fortran 95 does not have allocatable function results, but Fortran 2003
> does.
> Richard Maine discussed alternatives in the comp.lang.fortran thread
> "how to return a function result which can vary in size?"

Yes, this is exactly the kind of unnecessary deficiency I was referring to
when I used the phrase "computer-specific problems". These kinds of things
were fixed _decades_ ago and do not appear in any modern languages.
Suggesting that a new programmer learn a language plagued by such man-made
deficiencies is just plain sadistic.

Note that C++ has many of the same deficiencies. In C++, I often found
myself allocating arrays for all code inside a scope and then passing them
around by reference or even making them global. This kind of programming is
a complete waste of time and stems from poor language design. Java goes
some way to fixing these problems. The ML family of languages go even
further.

--
Dr Jon D Harrop, Flying Frog Consultancy
http://www.ffconsultancy.com
.



Relevant Pages

  • Re: Who uses clapack?
    ... > functions like SUM and MAXVAL and the ability to use array sections ... > drastically change the meaning of a Fortran code. ... >>Have you ever seen those bills for a Fortran compiler for an ... engineering applications in the C and C++ languages. ...
    (sci.math.num-analysis)
  • Re: Who uses clapack?
    ... > functions like SUM and MAXVAL and the ability to use array sections ... > drastically change the meaning of a Fortran code. ... >>Have you ever seen those bills for a Fortran compiler for an ... engineering applications in the C and C++ languages. ...
    (comp.lang.fortran)
  • Re: While(1) or for(;;) for infinite loops?
    ... inventor of C already ... Fortran lingo), dynamic memory allocation, and pointers (although a ... could be argued were inspired by other languages like C I suppose. ... stuff making it fundamentally an array based language. ...
    (comp.lang.c)
  • Re: Fortran 2003 and F
    ... reason I quit is that I find array declarations without DIMENSION to ... allocate,d) ... When an array is given dimensions such as, ... Fortran programmers know that by default, ...
    (comp.lang.fortran)
  • Re: OT: Different types of counting in loops
    ... In fortran you have: for 10 i=1,5 ... Why do all these languages do this in a different way? ... included a reasonable degree of support for the 0 based array alternative, ...
    (comp.lang.fortran)