Re: defining an arbitrary type in your newer Fortrans




Jan Vorbrüggen napsal:
P.S. I dont consider "derived types" a good substitute.

Why not?

The textual edits, in C, that #define something for something else are a hack
to paste over C's inadequate type system. There is no need for such in
Fortran. Everything is nicely handled by derived types.

Jan

And there is nothing that prevents you from using a preprocessor with
Fortran,
only there is not a standardized one (there will be in F2008). Many
compilers
support enhancing Fortran with C preprocesssing directives (usually
restricted,
because CPP is ill-suited for Fortran). I am (sometimes) using m4 with
Fortran
to get a quite satisfactory replacement for C macros and even C++
templates.

.



Relevant Pages

  • Re: defining an arbitrary type in your newer Fortrans
    ... to paste over C's inadequate type system. ... Everything is nicely handled by derived types. ... I don't see anything directly comparable in Fortran. ... Fortrans that have a macro preprocessor option, ...
    (comp.lang.fortran)
  • pointer bounds remapping
    ... Fortran 2003 allows specifying arbitrary lower bounds on pointer ... assignment, like this: ... which works with both g95 and Intel Fortran (and crashes compilation ... Is the above hack a standard Fortran? ...
    (comp.lang.fortran)
  • Re: concatenation for a filename
    ... while!= EOF) or similar. ... functionality in fortran yet. ... You can hack up some comparable stuff, but it is not simple or natural ...
    (comp.lang.fortran)
  • Re: function pointer
    ... > Is there truly a function pointer in Fortran? ... except in various nonstandard and nonportable forms. ... hack up various things - I've done so in the past by, for example, using ... but it can't be said to be in Fortran. ...
    (comp.lang.fortran)
  • Re-Writing the Kernel
    ... I propose to rewrite the kernel in FORTRAN. ... secure by eliminating buffer overflows. ... No one can hack a FORTRAN OS. ... We have Unix, Linux, and others. ...
    (comp.os.linux.security)