scott moore wrote:
>
> The function definitely isn't defined as a variable in it's body. The
> only valid reference to it is the last statement, myfun := nil, which
> is not, in fact, an assignment, but rather the establishment of a
> function result (for myfun). Although logically treating the function
> result as a "write only" variable is one implementation solution,
> there are many others. In fact, reduction to a single register is a
> reasonable optimization, and that, in and of itself implies that
> promoting function results to variables in attempts to achieve
> artificial orthogonality is unwise.
>
Well the function result is a variable. See 6.2.3.2(k) in Extended
Pascal. And that last statement is indeed an assignment-statement. See
6.9.2.2 in EP.
assignment-statement = ( variable-access | function-identifier ) ":="
expression
However, who said that variables can't live in registers? Who says that
variables have to even live the same register and/or memory location for
its lifetime? Don't confuse the semantic definition with an
implementation. The standard says nothing about implementation details
like registers, memory, stack, or even if you machine has registers or a
stack.
--
John Reagan
HP Pascal/{A|I}MACRO/COBOL for OpenVMS Project Leader
Hewlett-Packard Company


|