Menu

#223 Allow same name for section/paragraph as for varialbes

duplicate
closed
nobody
None
8
2018-05-14
2017-07-27
No

The Standard is quite clear on forbidding this:

Within a source element, a given user-defined word may be used as only one type of user-defined word with the following exceptions:

  1. a compilation-variable-name may be the same as any other type of user-defined word
  2. a level-number may be the same as a paragraph-name or a section-name
  3. the same name may be used as any of the following types of user-defined words:
    • constant-name
    • data-name
    • property-name
    • record-key-name
    • record-name

At least ACUCOBOL allows the same name in variables and sections paragraphs. I think it would be useful to add a compiler configuration for this, if it is set all paragraphs may get an internal prefix (both on creation and on references) or the reference lookup verifies the type of the reference.

Related

Wish List: #260

Discussion

  • Edward Hart

    Edward Hart - 2017-07-27

    You might want to examine [r1047] and [bugs:#268], which involved the similar problem of allowing redefinition of program-names. However, this problem was mixed up with basic program prototype support, so the [r1047] diff is quite hard to read.

     

    Related

    Bugs: #268


    Last edit: Edward Hart 2017-07-27
  • Simon Sobisch

    Simon Sobisch - 2018-05-14
    • status: accepted --> closed
    • Group: unclassified --> duplicate
     
  • Simon Sobisch

    Simon Sobisch - 2018-05-14

    Closed in favor of [feature-requests:#260].

     

    Related

    Wish List: #260


Log in to post a comment.