Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!att!linac!pacific.mps.ohio-state.edu!zaphod.mps.ohio-state.edu!uakari.primate.wisc.edu!aplcen!haven!adm!cmcl2!kramden.acf.nyu.edu!brnstnd From: brnstnd@kramden.acf.nyu.edu (Dan Bernstein) Newsgroups: comp.lang.misc Subject: Re: Answers, Chapter 2: to point or not to point Message-ID: <7006:Nov620:42:3990@kramden.acf.nyu.edu> Date: 6 Nov 90 20:42:39 GMT References: <1622:Nov606:57:0190@kramden.acf.nyu.edu> <5073@lanl.gov> Organization: IR Lines: 22 In article <5073@lanl.gov> jlg@lanl.gov (Jim Giles) writes: > From article <1622:Nov606:57:0190@kramden.acf.nyu.edu>, by brnstnd@kramden.acf.nyu.edu (Dan Bernstein): > | In article <3652@lanl.gov> jlg@lanl.gov (Jim Giles) writes: > |> x(1,:) = x(2,:) > | [ easy to see that there's no aliasing ] > | [ C version it's much harder, especially with the rows flipped ] > | Jim, I sympathize with the point you're trying to make, but this has > | absolutely nothing to do with pointers. If language L has array slicing > | and array assignment, then it will understand the above statement > | directly, and can optimize just as easily as Fortran. Pointers never > | appear. > However, the context of this discussion is whether to use arrays or > to use pointers _instead_. Exactly. That's why your example has nothing to do with this discussion. It should convince people that array slicing and array copying are useful features. I don't think any programmer is going to replace a single language builtin (such as x(1,:) = x(2,:)) with a series of statements, unless he's done some extensive tests showing how poorly the compiler handles the builtin. ---Dan