Hello,
From ISO spec:
production:
expression can be variable-access
variable-access can be function-identified-variable
function-identified-variable is pointer-function '^'
pointer-function is function-access
function-access can be entire-function-access
entire-function-access is function-designator
function-designator is function-name
But:
function test : boolean; begin test := false; end;
procedure test1; begin if test^; end;
generates the error "invalid type of argument of '^'"
function-identified-variable only appears on the rhs of the variable access production. The expression test^ seems lexically correct.
I know I am wrong. But where? How is function-identified-variable used?
I really can't understand 6.8.6.4 Function-Identified-Variables of the spec. It sounds like a function-identified-variable is the return value of a pointer function. Is test^ a pointer function?
Regards,
Paul Isaacs
On 23/01/17 02:36 AM, Paul Isaacs wrote:
function-identified-variable is pointer-function '^'
pointer-function is function-access
OK. Got it.
function access is an access through an array, record or string followed by a '^'
function-identified-variable is the variable returned by the dereference of a "pointer-function". A pointer-function is merely a semantic hint production, nothing more.
Semantic hints are a good idea but maybe they should be flagged as such so that the reader does not misconstrue them as having lexical significance.
Regards,
Paul Isaacs