Peter N Lewis wrote:
I agree with Frank. Pascal usually has exactly one way to access something, which follows from the logical construction of that something.
Umm, except for:
- Case variant records
I don't understand this one. Variant record fields and selectors are accessed with `.', like normal records.
- Variables passed by reference (but still within scope)
- Variables referenced by pointer
- Optionally qualified variables
I think we're at cross purposes. Of course, there can be aliasing (which you refer to) which gives several ways to access something dynamically (e.g., the target of pointer a can be the same as the target of pointer-field b of record c). What Chuck and I mean is that each static access has a unique way (e.g., if a is a pointer, then to dereference the pointer one uses a^; which doesn't preclude that there may be other ways to get at that target such as c.b^; neither that `^' can have different meaning when applied to different things, such as file buffer access; neither that one can do other things with a without `^', such as c.b := a).
Frankly I don't care whether only one or the other is legal (as long as the appropriate one is legal for a given object technology), but I also don't see any need to restrict it, since for any object o, and any method m, o.m and o^.m unambiguously mean the same thing and cannot mean anything else, whether both are legal or not. Allowing both means one less compiler switch,
If you mean that doing this would eliminate the difference between BP and Mac objects, I don't think so. There are other cases which conflict more directly. E.g., assignments between objects copy the reference in Mac and Delphi (AFAIK), but copy the object itself in BP. So we need that difference anyway, and blurring it in some cases (where it might not be a direct conflict) seems to lead to a more confusing whole in the end ...
Frank