Re: Variable length/precision formats?



Joe Krahn wrote:

Dan Nagle wrote:

Do you know of any implementations of VFEs that do run-time lookup
of names? Do you know of any proposals to add VFEs to the standard
that were submitted to the committee that included implementing VFEs
for any nonconstant format specifications?



The only discussion I recall of VFE in J3 Plenary ended quickly
with the unanimous agreement by all vendors present that they
were too difficult to implement for the value added to the processor.

There are simply other means (non-advancing transfers)
to accomplish the same goal. Other features of similar difficulty
to implement add greater value.

OK, a bit of summary. I don't use VFEs, so I'm guessing a bit.

VFE's are sensible to implement only within format statements and character literals or parameters, but not character variables or expressions. So, VFE interpretation should require only compile-time parsing of a format string.

A VFE can be manually created by the programmer with a simple internal write, so there is no real functionality benefit.

The primary case where a VFE may be different is being able to read a VFE variable into the active format statement, affecting a format later in the same read.

However, modifying a format statement while it is in use is certainly bad programming practice (like modifying write variables with functions inside the output item list), and can be done much cleaner by separating the read into parts using non-adnvancing I/O.

So, the only value in a 'good' VFE implementation is being shorthand for an internal write statement or character expression that generates a format manually.

Given that the only added functionality of a VFE is 'abusing' it by dynamically modifying it, most Standards people prefer the approach of simply using character variables and expressions rather than excluding dynamically-modified VFEs and adding a feature that provides no functionality.

In conclusion, if VFEs simply provice a shorthand for something you can already do with character variables/expressions, then what's the big deal? Or, are people specifically promoting VFE's for the dynamically-modifiable format [mis]feature?


If somebody came up with a superior implementation, I would support it. I do consider this an area of kludgyness in Fortran, but I can fairly easily get the results I need.

Joe


--

Gary Scott
mailto:garyscott@xxxxxxx

Fortran Library: http://www.fortranlib.com

Support the Original G95 Project: http://www.g95.org
-OR-
Support the GNU GFortran Project: http://gcc.gnu.org/fortran/index.html

Why are there two? God only knows.


If you want to do the impossible, don't hire an expert because he knows it can't be done.

-- Henry Ford
.



Relevant Pages

  • Re: Variable length/precision formats?
    ... Variable format expressions are not particularly ... When the VFE is ... The pointer to the array of pointers is passed ...
    (comp.lang.fortran)
  • Re: Variable Format Expressions (VFEs) (Was: Difference between Intel Visual Fortran and Compaq VF)
    ... Variable Format Expressions (VFE) have been an extension in many Fortran compilers for over two decades. ... Note that the VFE extension was before internal I/O was added to ...
    (comp.lang.fortran)
  • Re: Variable Format Expressions (VFEs) (Was: Difference between Intel Visual Fortran and Compaq VF)
    ... Variable Format Expressions (VFE) have been an extension in many Fortran compilers for over two decades. ...
    (comp.lang.fortran)
  • Re: Variable length/precision formats?
    ... VFE's are sensible to implement only within format statements and character literals or parameters, but not character variables or expressions. ... VFE interpretation should require only compile-time parsing of a format string. ... Given that the only added functionality of a VFE is 'abusing' it by dynamically modifying it, most Standards people prefer the approach of simply using character variables and expressions rather than excluding dynamically-modified VFEs and adding a feature that provides no functionality. ...
    (comp.lang.fortran)
  • Re: Variable length/precision formats?
    ... that were submitted to the committee that included implementing VFEs ... VFE's are sensible to implement only within format statements and character literals or parameters, but not character variables or expressions. ... Given that the only added functionality of a VFE is 'abusing' it by dynamically modifying it, most Standards people prefer the approach of simply using character variables and expressions rather than excluding dynamically-modified VFEs and adding a feature that provides no functionality. ...
    (comp.lang.fortran)