Path: utzoo!attcan!uunet!samsung!munnari.oz.au!goanna!ok From: ok@goanna.cs.rmit.oz.au (Richard A. O'Keefe) Newsgroups: comp.lang.misc Subject: Re: Some things that pointer-less languages can't do efficiently Message-ID: <4223@goanna.cs.rmit.oz.au> Date: 8 Nov 90 10:33:50 GMT References: <26739:Oct1023:44:2690@kramden.acf.nyu.edu> <65450@lanl.gov> <3716@skye.ed.ac.uk> Organization: Comp Sci, RMIT, Melbourne, Australia Lines: 27 In article <3716@skye.ed.ac.uk>, jeff@aiai.ed.ac.uk (Jeff Dalton) writes: > In article <3975@goanna.cs.rmit.oz.au> ok@goanna.cs.rmit.oz.au (Richard A. O'Keefe) writes: > > >(Since Lisp has rplaca/rplacd -- or, in Scheme, set-car!/set-cdr! -- Lisp > >is a very poor example of a "pointerless: language...) > > In Lisp/Scheme, everything (all values of variables) is essentially a > pointer. But then you can factor out the phrase "pointer to" and > regard variables as naming the objects directly. So that's a sense > in which Lisp and Scheme don't have pointers. Jim Giles has been saying at great length that the problem is ALIASING. (The "recursive data structure" notation he has hinted at from time to time is essentially "access types without aliasing + high level shuffling operations that preserve lack-of-aliasing".) If I do (let* ((x (list 1 2 3)) ; [1 2 3] -> x; (y (list x x))) ; [%x, %x] -> y; (setf (first (first y)) 42) ; 42 -> y.hd.hd; y) ; y; the answer comes back as ((42 2 3) (42 2 3)) ^^ this changed too! The fact that (first (second y)) changed when (first (first y)) was updated is precisely the kind of aliasing that was being blamed on pointers. -- The problem about real life is that moving one's knight to QB3 may always be replied to with a lob across the net. --Alasdair Macintyre.