When is a cast not a cast?

Karl Heuer karl at haddock.ima.isc.com
Sun May 21 09:21:17 AEST 1989


In article <2922 at buengc.BU.EDU> bph at buengc.bu.edu (Blair P. Houghton) writes:
>Could it be that adding pointers creates different things, as multiplying
>lengths creates areas?  Maybe.

Aha, maybe now we're getting somewhere.  I was hoping you'd realize that, if
this concept makes any sense at all, it would have to generate a new type, a
ptrsum_t.  Now, if you want to argue that ptrsum_t should exist (its major
property being that you can subtract a pointer from it and get a pointer, and
perhaps also allowing ptrsum_t/2 --> pointer), then I'll be much more
supportive than if you continue the false analogy of ptr+int vs float+int.

Even so, there's a lot of work that would need to be done to make this useful
to portable programs.  It's my opinion that it probably can't be done, and
even if it can, that it's not worth the effort.  If you'd like to prove me
wrong, go ahead.

In another article,
>And you whining toadies who do it so smugly don't give a flying fractal
>whether you cripple the language while you're at it.  Who's righter?

I think that someone who proposes that we
>make it necessary to do pointer+(pointer_type *)int to get the
>current functionality of pointer+int,
should not be one to accuse others of crippling the language.

Karl W. Z. Heuer (ima!haddock!karl or karl at haddock.isc.com), The Walking Lint



More information about the Comp.lang.c mailing list