Re: why doesn't this compile ?



In article <1114635172.915844@xxxxxxxxxxxxxxxxxxxxxxxxxxx>,
Bart Vandewoestyne <MyFirstName.MyLastName@xxxxxxxxxx> wrote:

> I am cleaning up my directory with test and example programs, and I came
> across the following testprogram that I've written somewhere in the past:
>
> http://www.cs.kuleuven.ac.be/~bartv/downloads/test_array_arguments.f95
>
> I guess I wanted to demonstrate to myself how to write a function that
> can act on arrays of both rank 1 and rank 2, but unfortunately this
> thing doesn't compile anymore.

Looks fine to me. And it compiles and runs fine with both compilers that
I just tried (Nag and g95). This suggests a compiler problem.

I'll note, as an aside, that I find the description of it as "a
function" to be slightly misleading. It is 2 different functions that
have the same generic name. Yes, it "looks" sort of like a single
function to the caller, which is a nice feature of generics, but on
still has to actually write the 2 functions (which can do entirely
unrelated things, though that would be a bad idea for clarity).

To me an elemental function would be "a function that can act on arrays
of both rank 1 and rank 2". (Though elementals are very restrictive -
the applications in this sample wouldn't fit in the elemental mold at
all).

--
Richard Maine | Good judgment comes from experience;
email: my first.last at org.domain | experience comes from bad judgment.
org: nasa, domain: gov | -- Mark Twain
.



Relevant Pages

  • why doesnt this compile ?
    ... I am cleaning up my directory with test and example programs, ... across the following testprogram that I've written somewhere in the past: ... can act on arrays of both rank 1 and rank 2, ... If i compile it with my F-compiler I get: ...
    (comp.lang.fortran)
  • Re: What about turbos?
    ... In Delphi.NET TSomeClasssatisfies a compile time check but ALSO ... Type checking with a cast is at runtime. ... As maybe - I haven't really thought about the .NET generics implementation as ... ensure that they get that type (or NIL as you pointed out). ...
    (borland.public.delphi.non-technical)
  • Re: .NET 2.0 to be launched on Nov 8
    ... native for generics to work. ... > and probably Delphi for Win32 RSN. ... > do when they compile a template, ...
    (borland.public.delphi.non-technical)
  • Re: Ambiguous interfaces
    ... Generic resolution is done at compile time; ... > from any thing else in generics. ...
    (comp.lang.fortran)
  • Re: .NET 2.0 to be launched on Nov 8
    ... One does delegation out ... >> difference in philosophy between generics and templates. ... do when they compile a template, ...
    (borland.public.delphi.non-technical)