L
luserXtrog
Thanks, Korzybski.
But there is also a basic similarity between addresses and integers,
particularly where the integer is employed to index an array.
A pointer is an index to any location in the process memory space.
Using an index to a smaller portion of that memory can improve
locality.
You can probably find a basic similarity between just about any two
concepts.
Your model of a pointer as "an index to any location in the process
memory space" assumes a monolithic linear addressing space, where all
of memory can be treated as a single array of bytes. C does not
require such a model, and there are machines that don't use it.
You can add or subtract an integer to a pointer and get another
pointer, you can subtract one pointer from another to get an integer,
and you can compare two pointers using <, <=, >, or >=. But all
these operations are defined only within a single object.
[...]
Understood. But as a neo-pythagorean, my hackles rise automatically
when anyone suggests X is not a number. My sense of holism attempts
to retaliate by identifying a universe of discourse in which the
two dissolve into one. Occasionally this corresponds to mathematical
abstraction; but often it is merely poetic.
Perhaps the true situation is more of a superposition of the dual
intepretation: pointers are numbers and pointers are not numbers.
I think [feel] that in this example the similarities are more
important than the differences; because it may lead to the notion
of separating the boolean nature of the function's return value
from the resulting encoded output.