Record fields / Array elements as VAR parameters
Record fields / Array elements as VAR parameters
Can a field (or array element) be an argument corresponding to a VAR parameter, i.e. are fields and array elements considered "variables"?
-
- Site Admin
- Posts: 525
- Joined: Fri Dec 31, 2010 12:30 pm
- Contact:
Re: Comparing pointers (including extensions)
The current version of Astrobe allows this. Do you have any reason to believe it should not?
Re: Record fields / Array elements as VAR parameters
No. This is addressed by a section (9.2) on procedure call that I'd forgotten about:
I have a slight difficulty with the fact that parameters are discussed in two separate sections of the spec. (It's not the only place this happens: assignment to procedure variables is described in the section on procedure types (6.5) rather than the section on assignment (9.1), and NEW is defined in (6.4) on pointer types rather than (10.2) on predefined procedures.)In the case of variable parameters, the actual parameter must be a designator denoting a variable. If it designates an element of a structured variable, the selector is evaluated when the formal/actual parameter substitution takes place, i.e. before the execution of the procedure.