Path: utzoo!attcan!uunet!sdrc!scjones From: scjones@sdrc.UUCP (Larry Jones) Newsgroups: comp.lang.c Subject: Re: When is a cast not a cast? Message-ID: <730@sdrc.UUCP> Date: 20 May 89 18:28:37 GMT References: <2747@buengc.BU.EDU> <10191@smoke.BRL.MIL> <406@skye.ed.ac.uk> <2922@buengc.BU.EDU> Organization: Structural Dynamics Research Corp., Cincinnati Lines: 29 In article <2922@buengc.BU.EDU>, bph@buengc.BU.EDU (Blair P. Houghton) writes: > Could it be that adding pointers creates different things, as multiplying > lengths creates areas? Maybe. Yes! However, adding pointers is more like multiplying areas -- it creates some new thing, but we don't have any word to describe the result. Why not? Probably because most people haven't felt a need for one -- the result doesn't have any physical analog, nor does it have any particularly interesting properties (other than you can reverse the operation to get back what you started with). Pointer addition has an additional problem, however. We know how to multiply areas because area is represented as a scaler value and we know how to multiply scalars. On the other hand, pointers are NOT scalars and we just don't know how to add them. At the risk of attracting snide remarks, let me try yet another analogy: Dates are pointers to days. You can add 3 (days) to June 3, 1978 to get June 6, 1978. You can subtract February 28, 1984 from March 1, 1984 to get 2 (days). But how do you add May 10, 1980 to May 20, 1980? ---- Larry Jones UUCP: uunet!sdrc!scjones SDRC scjones@SDRC.UU.NET 2000 Eastman Dr. BIX: ltl Milford, OH 45150-2789 AT&T: (513) 576-2070 "You can't get a body like mine in a bottle -- unless you push REAL HARD." - Judy Tenuta / Dr. Pepper