Re: macro preprocessor semantics and the ANSI standard



"Thomas David Rivers" <rivers@xxxxxxxxxx> wrote in message news:4C28A279.6040206@xxxxxxxxxxxxx
| robin wrote:
|
| > The manual is perfectly clear about what you can't do.
| > No need to "try it and see".
|
| Except that when I did "try it", the behavior in the manual
| didn't reflect what the compiler appeared to be doing.

The manual clearly defines what the programmer can do (wrt
%GO TO). Anything outside that is a violation.

| The IBM compiler does, in fact, allow a goto to branch back to
| preceeding label... which, in the context of %if, might
| actually make sense.
|
| Furthermore, contrary to the manual, a %goto can branch
| to a label in the including file, not necessarily in the
| current file. The behavior in this case is awkward, and
| perhaps unintentional. But, I have learned that if the compiler
| allows it, some enterprising developer will take advantage
| of it and "cry foul" if the behavior were to be 'corrected'.

Compilers [in general] aren't always able to give a diagnostic for
every violation of the language.

| On a quick glance through the IBM manual, I noticed other
| discrepencies which tend to make me wonder about its completeness
| vis-a-vis a description of the language actually accepted by
| the IBM PL/I compiler and the behavior of the execution
| of PL/I programs.
|
| For example, the description of the DO statement
| provides syntax diagrams for 3 different types.
| And, the subsequent description goes on to mention
| UPTHRU and DOWNTHRU clauses which are not described
| in the syntax diagrams.

Which manual are you looking at?
Mine has syntax diagrams for DOWNTO and UPTHRU.

| I'm sure these are simple oversights, but it means
| that reading the IBM manual will not give you a
| description of the language, and begs the question
| of what, perhaps more subtle and important, details
| have suffered the same oversight.

The manual really does give a description of the language.

| Also - the IBM-compiler-defined language
| appears to deviate from the ANSI standard, so reading
| the ANSI PL/I standard doesn't provide a definition
| of the language as it's used today.

The IBM compiler gives options for ANS and IBM rules.
You choose.

| So, from a practical point of view; we have many
| companies who write millions of lines of PL/I and
| depend on it daily, without a complete specification
| of what the PL/I language may or may not be.

I think that you will fund that the IBM manual covers the language.

| I feel this
| leads to developer speculation and "mystical programming
| magic" in the sense that we are left with 'try it and
| see what happens'. This is evidenced by the trepitude
| by which people cling to the "old" PL/I compiler in lieu
| of migrating to the "enterprise PL/I compiler". The
| only way they can know if their programs will work
| is 'try it and see'. To avoid that effort, they
| simply continue to use the old compiler.
|
| If I were a lead technical officer at some large
| company; this state of affairs would, I think,
| add weight to the idea of migrating away from PL/I
| in favor of a more rigorously defined environment.
| (Not that it would be the _sole_ reason, just part
| of a larger argument, I think.)

You will find that that argument can apply to any compiler and any language.

| That issue would be resolved by an agreed-upon
| standard. If all such a standard did was to
| codify the existing IBM compiler behavior; it
| would, I think, be welcome by the existing
| community of PL/I developers, and provide a clear
| path for new development (of PL/I language
| implementations to be sure, but more importantly,
| PL/I programs.)
|
| The point is likely moot, though, as the
| community did not have the collective will
| to push for an updated ANSI standard when
| the opportunity arose.
|
| Perhaps the way to go would be a "wiki"
| or on-line group-editable document that could
| augment the IBM documentation to provide more
| clarity? Maybe someone has already done that?
|
| To return to the original idea...
|
| I feel the IBM manual is incomplete; I believe
| a casual perusal of the IBM manual (for I have
| not read it in entirely) demonstrates this and I
| have cited a few situations in support of that.
| This leaves one with, I think, the only option
| of 'try it and see'.

The only examples that you gave did not provide
evidence of any of that.

| I feel it would be in the interest of PL/I
| programmers to have a more definitive standard.


.



Relevant Pages

  • Re: Tracing the Evolution of CP/M-80
    ... Is there a version of CP/M written in PL/I? ... PL/M-80 is a programming language for i8080 systems. ... PLM81 FOR Source for Pass 1 of the compiler. ...
    (comp.os.cpm)
  • Re: macro preprocessor semantics and the ANSI standard
    ... The IBM compiler does, in fact, allow a goto to branch back to ... of PL/I programs. ... appears to deviate from the ANSI standard, ...
    (comp.lang.pl1)
  • Re: macro preprocessor semantics and the ANSI standard
    ... The IBM compiler does, in fact, allow a goto to branch back to ... of PL/I programs. ... appears to deviate from the ANSI standard, ...
    (comp.lang.pl1)
  • Re: The value of a CS education
    ... either features of the language ... COBOL came along after FORTRAN, and added nothing that a numerical ... because of repeated schedule slips during the introduction of IBM System ... BASIC compiler for DOS. ...
    (sci.electronics.design)
  • Re: The value of a CS education
    ... either features of the language ... COBOL came along after FORTRAN, and added nothing that a numerical ... because of repeated schedule slips during the introduction of IBM System ... BASIC compiler for DOS. ...
    (sci.electronics.design)