3 ms·
That would invert the use in Pascal where P := @X; means assign the address of X to P. And Y := P^; means dereference P and assign the result to Y. I think
by by 16y ago
That would invert the use in Pascal where
P := @X;
means assign the address of X to P. And
Y := P^;
means dereference P and assign the result to Y.
I think anyone who has written any Pascal/Delphi would prefer ^ for dereference.
- btilly 16y agoAnyone who has done a lot of bit twiddling in C has other uses for ^. (I find it ironic that 4^5 has an obvious meaning outside of programming that it doesn't have in a large variety of widely used programming languages.)
- Groxx 16y agoC and many other languages. ^ is very nearly a universal code-XOR, at least where single-characters are concerned.
- by 16y agoI suppose they should be allocated based on frequency of use within the intended domain of the language, with the most frequent getting first choice. I guess pointer dereferencing would be more important than xor for most domains. Not that I am particularly advocating ^ for pointers, * is just as good, but I do think using @ for the opposite of its meaning in Pascal would be confusing.