Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uniform syntax #53

Open
certik opened this issue Oct 27, 2019 · 0 comments
Open

Uniform syntax #53

certik opened this issue Oct 27, 2019 · 0 comments
Labels
Clause 10 Standard Clause 10: Expressions and assignment

Comments

@certik
Copy link
Member

certik commented Oct 27, 2019

Extracted from #49. Author: Van Snyder

Reference: Correspondence preceding 1986 Albuquerque meeting.

Uniform referential syntax to array elements, updaters and structure components increases
software mutability, and therefore decreases maintenance costs. (The alternative is to follow
Parnas’s advice to encapsulate everything in procedures — which provides uniform referential
syntax with higher labor expense and lower performance). To move in that direction, it ought to
be allowed to access a structure component using the syntax component(structure). This should
be classed as a generic updater. To avoid a conflict with an array of the same name as component an array ought to be considered to be a generic updater. Access to type-bound procedures or
procedure pointer components with PASS OBJ could require the structure to be first, or to be
in the same place in the reference as the corresponding dummy argument. For symmetry with
this syntax, array components should be referenced as component(structure,subscript,. . . ). A
small step in the direction of uniform syntax is to allow type-bound functions to be referenced
without parentheses enclosing the empty argument list. An anti-symmetric change to allow a
scalar to be referenced with an empty subscript list would make it impossible to know, and
impossible for the syntax to depend upon, whether a reference to an entity of a derived-type
object is a reference to a component or a type-bound function or updater. To complete the
ability to convert an entity between an array, structure component and updater, an integer
interval type, using the same constructor as a subscript triplet, is needed to allow an updater
reference with the same syntax as an array section reference.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Clause 10 Standard Clause 10: Expressions and assignment
Projects
None yet
Development

No branches or pull requests

1 participant