CBFalconer wrote:
Frank Heckenbach wrote:
CBFalconer wrote:
... snip ...
- Variables referenced by pointer
No such thing in standard Pascal. Pointers are only initialized by new.
Even then there can be aliases after pointer assignments.
Copies, yes.
No, aliases. If you do:
var a, b: ^Integer;
begin New (a); b := a; end;
Then both a^ and b^ refer to the same target. The pointers are copies, but the target is identical. Note that ISO Pascal actually calls these targets "variables", so Peter's terminology was really correct according to ISO:
: 6.6.5.3 Dynamic allocation procedures new(p) : : shall create a new variable that is totally-undefined [...]
I was referring to the bars against creating pointers to ordinary variables with all the attendent insecurities.
Well, these insecurities are not bigger than dangling pointers. This can be easily proven. You might want to look up my discussions with Scott Moore in the newsgroups (some years ago) about this.
Frank