Re: convert f77 code from mixed case to lower case



Rich Townsend <rhdt@xxxxxxxxxxxxxxxxxxx> wrote:

But when it comes to writing a program to case-convert, that takes into
account f77 comment lines, I imagine Perl is a far better choice than
Fortran. By 'better', I mean that the resulting program would be (a)
shorter and (b) more transparent (to someone familiar with both
languages).

If you like, you can offer a Fortran program that does the job, and I will
offer a Perl script. Then, we could ask the group to give their views on
our respective attempts.

Comment lines is the trivial case. I could do that one on Fortran with
my eyes closed, and the usual advice on choosing programming languages
applies - use one you are comfortable with unless there are overriding
priorities. I absolutely guarantee you I would find a well-done Fortran
version more clear. This has nothing to do with any notion of one
language being better than the other for the task. It has everything to
do with the fact that I am very fluent in Fortran, but I have to
carefully go through Perl character-at-a-time with a manual open. I'm
quite sure I could become fluent in Perl, given enough time. But it
would take multiple orders of magnitude more time to get that fluency
than to write the program in question. I could probably bang out that
program in 5 minutes, and I sure couldn't become fluent in Perl in 50
minutes - or 500.

That aside, the OP also specified character strings and Hollerith. Were
I writing a spec for such a thing, I'd also include trailing comments in
addition to comment lines, but the OP didn't ask for that. (Though there
is at least half a chance that's because he forgot to). Hollerith, in
particiular, is *MUCH* harder than cmment lines. It is downright hard,
particularly if you insist on it working with some common extensions.
See other posts in the thread. Just doing comment lines isn't even much
of a start... no matter what language you choose. The algorithm is the
hard part here - not the language.

--
Richard Maine | Good judgement comes from experience;
email: last name at domain . net | experience comes from bad judgement.
domain: summertriangle | -- Mark Twain
.



Relevant Pages

  • Re: convert f77 code from mixed case to lower case
    ... value between lowercase and uppercase letters. ... It would be strange to see someone use Fortran for such a task. ... Language using US/UK versions of the ascii table. ... I imagine Perl is a far better choice than Fortran. ...
    (comp.lang.fortran)
  • Re: convert f77 code from mixed case to lower case
    ... I imagine Perl is a far better choice than ... If you like, you can offer a Fortran program that does the job, and I will ... offer a Perl script. ... Perl has language builtins that are specifically aimed at doing search/replace on text. ...
    (comp.lang.fortran)
  • Re: When clever is stupid
    ... There are a lot of things I wouldn't use Fortran for, ... But despite its original intent as a systems programming language, ... Perl does garbage collection via reference counting, ...
    (comp.lang.ruby)
  • Re: convert f77 code from mixed case to lower case
    ... If you like, you can offer a Fortran program that does the job, and I will ... offer a Perl script. ... language being better than the other for the task. ... quite sure I could become fluent in Perl, ...
    (comp.lang.fortran)
  • Re: Upgrading an OLD (Fortran Powerstation 4.0) compiler
    ... a local web/CGI server in only 51 lines! ... Will the same Perl script work on both Windows and Linux? ... One idea that I had was to use HTML forms to ... > the Fortran. ...
    (comp.lang.fortran)