Recently, I had cause to review the spec in terms of function parameters, and argument passing. [This was regarding adding future support for ref readonly parameters.] I found a lot of places where the text could be considerably simplified, made consistent, or have duplication of normative text removed. This issue deals with one aspect, and is not intended to result in any semantic changes. Rather, it is intended to create a better base on which to add future feature specs. Hopefully, we can decide offline on each proposal without taking up TG2 meeting time.
A parameter declared with an in modifier is an input parameter.
So, the term “input parameter” is defined (and matches the parent section name). However, while 61 occurrences of text about input parameters uses that term, 33 occurrences use “in parameter” instead, for no obvious reason and with no value added.
[There is no such duplication for “value parameter.” 9.2.5 Value parameters states: “A parameter declared without an in, out, or ref modifier is a value parameter, and “value parameter” is used throughout.]
Proposal
Change all “in parameter” to “input parameter.”
Change all “out parameter” to “output parameter.”
Change all “ref parameter” to “reference parameter.”
Also, change such text not having the backticks, as in “out parameter.”
Change the term definition “by-reference parameter” to “by-reference parameter.”
Change all enumerated lists “input, output, and/or reference parameter” to the corresponding group term “by-reference parameter.”
Discussion
The term “by-reference parameters” is defined in 15.6.2.3.1 General and only referenced in Clause 15. It’s simply used to organize related subclauses as a group, so let’s use it instead of an enumerated list of its members.
Recently, I had cause to review the spec in terms of function parameters, and argument passing. [This was regarding adding future support for
ref readonly
parameters.] I found a lot of places where the text could be considerably simplified, made consistent, or have duplication of normative text removed. This issue deals with one aspect, and is not intended to result in any semantic changes. Rather, it is intended to create a better base on which to add future feature specs. Hopefully, we can decide offline on each proposal without taking up TG2 meeting time.Issue
Variables.md, 9.2.8 Input parameters, states
So, the term “input parameter” is defined (and matches the parent section name). However, while 61 occurrences of text about input parameters uses that term, 33 occurrences use “
in
parameter” instead, for no obvious reason and with no value added.The same situation exists for “output/
out
parameter” (9.2.7 Output parameters) and “reference/ref
parameter” (9.2.6 Reference parameters).[There is no such duplication for “value parameter.” 9.2.5 Value parameters states: “A parameter declared without an
in
,out
, orref
modifier is a value parameter, and “value parameter” is used throughout.]Proposal
in
parameter” to “input parameter.”out
parameter” to “output parameter.”ref
parameter” to “reference parameter.”Discussion
The term “by-reference parameters” is defined in 15.6.2.3.1 General and only referenced in Clause 15. It’s simply used to organize related subclauses as a group, so let’s use it instead of an enumerated list of its members.