In a world of qualified only pointers, many unsafe languages become safe.
Take for instance, the possible choices:
pushed * : pointer to <insert type> allocated on the stack
pooled * : pointer to <insert type> allocated on the heap
intern * : pointer to <insert type> local method allocation
extern * : pointer to <insert type> nonlocal method allocation
There are others, like method * and shared *, but they are hard to explain to n00bs.
Without generic one-type-fits-all pointers and the disallowance of casting between pointers, it would become impossible to manipulate instances of user defined classes. And, that's not all; many problems could be caught by a compiler that previously could not be.
Ha! Revel in my genius!
Name:
Anonymous2007-05-12 6:21 ID:aX8i7aTe
We have languages without pointers, noone is going to bother with your silly qualified pointers.
Name:
I are epic sage2007-05-13 7:03 ID:47LL1JSS
Those who refuse to acknowledge my greatness will be punished.
And you are wrong...there is no language of any practical use that does not have pointers. Even if you can't see them, they are there.
We have languages with automatic memory management, noone is going to bother with your silly qualified pointers.
Name:
Anonymous2007-05-13 7:18 ID:ZhciL1Co
in the same way that everything a computer does involve change in electron flow, but having to involve such a thing in your coding would make hello world the lenght of the bible.
you fail.
Name:
Anonymous2007-05-13 7:20 ID:47LL1JSS
>>4
Who said the language I am referring does not have automatic memory management? If you do it right, it is great; if not, it is massive phail.
intern Object pooled *o = new Object;
Deletes just before program termination ('intern' is same as static storage).
>>6
I suppose you think alloca() is a good idea, too?
This whole idea will never catch on, for much the same reason that reinterpret_cast and the like are also stupid.
Name:
Anonymous2007-05-13 8:53 ID:47LL1JSS
>>10
New is same as C++, except for placement new, which is different. I didn't even mention casts, so how can you comment on them?
Name:
Anonymous2007-05-13 18:20 ID:4n+IGujd
>>11
I'm comparing the typed pointers to the fact that people still write (char *) a in C++ code, instead of the longwinded reinterpret_cast<char *>(a).
>>12
In the language I am referring to, pointer casting is prohibited save the single exception where it is allowed for base/derived class types. That is how it should be.