With this vocabulary:
variable: A memory location which is reachable (i.e., not garbage). [*]
pointer: The address of a variable.
pointer variable: A variable which contains a pointer.
access: For a pointer p, any dereference of p—*p, p->field, or p[i]—whether for the purposes of reading or writing to that variable.
And considering:
any specific pointer variable ("ptr"), and
all accesses which parrot might perform[**] on any pointer ever stored in ptr ("A") [***], and
any proposed assignment to ptr
Then:
If any A which once accessed a pointer variable would now access a non-pointer variable,
Then the proposed assignment MUST NOT be performed.
D'oh. This actually has to be recursive.
Considering:
any specific pointer variable ("ptr'), and
all accesses which parrot might perform on any pointer ever stored in ptr,
and all accesses which parrot might perform on any pointer ever stored in those variables,
...,
... "A", and
any proposed assignment to ptr
else it allows
char * a = ...; char ** b = a;
Doesn't change the conclusions I drew at all. (Nor does it require some massively recursive algorithm to run at pointer assignment time, just as the first one didn't require anything more than pointer assignment at pointer assignment time.) Could probably be simplified with the addition of pointer type to the definitions section.
Anyhoo.
—
Gordon Henriksen [EMAIL PROTECTED]