From: ········@bayou.uh.edu
Subject: Re: C++ briar patch (Was: Object IDs are bad)
Date: 
Message-ID: <5ln5nq$bcs$3@Masala.CC.UH.EDU>
Erik Naggum (····@naggum.no) wrote:
: * ········@Bayou.UH.EDU
: | Of course if there is something that I'm missing that makes this
: | low level construct a necessity for a high level concept (OO) then
: | I would appreciate it if you would enlighten me.

: pointers are useful in many ways for many reasons, but the crucial question
: is whether you should be able to do more than obtain and dereference them.
: the view that the pointer is an arithmetic type is the culprit.

I think the question goes further to "do we even need to obtain and
dereference them?".  I'm using Scheme, and before that Haskell -- 2
languages without pointers, and I've yet to run into a situation
where I even remotely missed them much less thought about them.



: #\Erik
: -- 
: if we work harder, will obsolescence be farther ahead or closer?

--
Cya,
Ahmed
From: Hrvoje Niksic
Subject: Re: C++ briar patch (Was: Object IDs are bad)
Date: 
Message-ID: <kiglo5cvkki.fsf@jagor.srce.hr>
········@Bayou.UH.EDU (········@bayou.uh.edu) writes:

> I think the question goes further to "do we even need to obtain and
> dereference them?".  I'm using Scheme, and before that Haskell -- 2
> languages without pointers, and I've yet to run into a situation
> where I even remotely missed them much less thought about them.

Are you sure you and Erik agree on the definition of a pointer?
Consider, for example, the Lisp expression:

(setq foo (vector 1 2 3))

The variable FOO could be regarded as a pointer to a vector.  By
accessing it, you are dereferencing the pointer.  The only difference
between FOO and a pointer in C is that you cannot pretend that FOO has 
inherent arithmetic properties.

Furthermore, a second variable BAR can be defined as:

(setq bar (vector 1 2 3))

Now we have another pointer to another vector, and EQ predicate can be 
equivalent to pointer comparison in C:

(eq foo bar)
  => NIL

Just like with "real" pointers, you can assign values:

(setq foo bar)          ; the FOO vector goes to gc hell

(eq foo bar)
  => T

This is because FOO and BAR now point to the same object.  Indeed
there is very little difference between this, and:

char *foo = strdup ("string");
char *bar = strdup ("string");

...where the expression `foo != bar' will yield 0, and you can assign
values foo to where bar points to, etc.

I don't know about Haskell, but Lisp (and presumably Scheme) certainly
does possess an abstraction of pointers, even if they are not named
thus.

-- 
Hrvoje Niksic <·······@srce.hr> | Student at FER Zagreb, Croatia
--------------------------------+--------------------------------
I'm sure they'll listen to reason! -- Neal Stevenson, _Snow Crash_