Re: A few syntax questions



Joe Krahn <krahn@xxxxxxxxxxxxx> wrote:

So, it seems that they are included due to the presence of an implicit
RETURN, if reached, even though they are themselves not really an action
statement. Still, I think putting them in the 'action-stmt' syntax rule
is an unneeded complication. Maybe a note about implicit returns would
be better.

I'm afraid I am not interested in discussing how to optimize the bnf of
the standard. If I were to redo the bnf from scratch, I'd do many things
differently. Some of them evenhave technical impact instead of just
editorial. There are a few annoying "features" that have, in my opinion,
no real technical justification, but it would have made the bnf messier
to make them "right". (High on that list is the mess whereby -32768 is
always parsed as a unary minus operating on a positive 32768, with the
result that it overflows in 16 bits. I'm sure that can be solved; heck,
some compilers do so; it is just messier to write bnf for doing it
"right".)

Because it is for backwards compatibility, it seems that it
would be realitvely easy to restrict newer constructs to being used only
in case sensitive (free-form) source code.

I tried suggesting that once. Actually more than once. There are a few
cases where f90 syntax is uglier than it would "need" to be if it were
restricted to free source form. And there are some inherited f77 syntax
items like that also, such as the parens in the parameter statement.

But to say that I got no interest would be an overstatement. What I got
was much more along the lines of "even if it comes out of the standard,
vendors will keep supporting fixed source form and will object to new
features that won't work in it...because their users will object."

That's the longer, polite version of the responses I got. :-)

For an allocatable item, it seems only the LEN integer is this type of
constant.

No. It isn't a constant in that sense at all. You can change it by
reallocating. Ah, if you are going to say that reallocating doesn't
"count", then evidently you don't literally mean "not modifiable". You
mean something more like "not modifiable in ways that count" (probably
not quite using that terminology :-)) and then define the exact details.

Also, it doesn't mean the other part of your definition because a LEN
type parameter of an allocatable isn't a data object with an actual
defined place that you can point to. Odds are good that the
implementation must have stashed it in memory somewhere, but you
certainly can't point to it.

--
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

  • Re: A few syntax questions
    ... I think putting them in the 'action-stmt' syntax rule ... If I were to redo the bnf from scratch, ... I guess that means that a standard conforming compiler is supposed to overflow. ... I am hoping that F2003 features will regain some respect for Fortran in CS departments,, and not just be coinsidered an old archaic language for old programs, but such strong support of archaic Fortran standards is a major reason why Fortran popularity continues to dwindle. ...
    (comp.lang.fortran)
  • Re: A few syntax questions
    ... I think putting them in the 'action-stmt' syntax rule ... If I were to redo the bnf from scratch, ... I guess that means that a standard conforming compiler is supposed to overflow. ... I am hoping that F2003 features will regain some respect for Fortran in CS departments,, and not just be coinsidered an old archaic language for old programs, but such strong support of archaic Fortran standards is a major reason why Fortran popularity continues to dwindle. ...
    (comp.lang.fortran)
  • Re: A few syntax questions
    ... I think putting them in the 'action-stmt' syntax rule ... If I were to redo the bnf from scratch, ... I guess that means that a standard conforming compiler is supposed to overflow. ... I am hoping that F2003 features will regain some respect for Fortran in CS departments,, and not just be coinsidered an old archaic language for old programs, but such strong support of archaic Fortran standards is a major reason why Fortran popularity continues to dwindle. ...
    (comp.lang.fortran)
  • Re: VIM : used for Fortran files .f or .f90
    ... Fortran 9x code can be in either fixed or free source form. ... When you create a new fortran file, the syntax script assumes fixed source ... fortran files with an .f90 extension are written in free source form and the ...
    (comp.editors)
  • Re: What did I do?
    ... real function fnc ... Just what does that syntax do? ... first you probably used fixed source form instead of the free ... didn't use implicit none, so the lack of declarations isn't caught. ...
    (comp.lang.fortran)