From ... From: Erik Naggum Subject: Re: C++ briar patch (Was: Object IDs are bad) Date: 1997/05/29 Message-ID: <3073883060789102@naggum.no>#1/1 X-Deja-AN: 244669841 References: <5mfos6$ngp$1@masala.cc.uh.edu> <5mhh8h$gkq@web.nmti.com> <3073830464727184@naggum.no> <5mi2j9$dc@web.nmti.com> mail-copies-to: never Organization: Naggum Software; +47 2295 0313; http://www.naggum.no Newsgroups: comp.lang.scheme,comp.lang.lisp,comp.lang.misc,comp.lang.functional,comp.lang.c++ * Peter da Silva | What's the difference between a slot and a pointer, semantically? hello? the same difference as between a struct member and pointer. | "Returning the contents of" is "dereferencing". really? suppose a cons is defined as struct cons { Object car, cdr; }; and a struct cons foo and exists. the C expression `foo.car' returns the contents of the `car' slot (struct member). suppose that struct cons *bar is a pointer. while `*bar' dereferences the pointer, `bar->car' and (*bar).car returns the contents of the `car' slot in the pointed-to cons. | Let's say I defined a C-like language with "slots" instead of "pointers". I wonder, have you never seen the word "slot" before? Lisps have had `defstruct' in various shapes and forms for a _very_ long time. the word "slot" is used for the individual objects that go into a structure. | (remember, I'm just responding to an assertion that pointers, as defined | above, don't exist in scheme) I think your responses on Lisp in general and this issue in particular are very weak. in a language like C that has a type that is a pointer to another type, and the programmer is able to manipulate the pointer as a value, "dereferencing" has meaning. in a language like Scheme or Lisp where you cannot take the address of objects, and you cannot manipulate the pointer itself, it has no meaning to talk of "derefencing" even though it would have been meaningful if you had implemented this language in a C-like language. of course Scheme _uses_ pointers in the C sense for its memory accesses, but Scheme itself doesn't expose them to the programmer. it's a slightly confusing issue, obviously, but it's worth noting that a Scheme programmer who doesn't understand that he's dealing with pointers to objects will be very confused by the language, and a Scheme programmer who thinks in terms of pointers will have a hard time writing serious code in in Scheme -- he wouldn't see the data structure because of all the pointers. #\Erik -- if we work harder, will obsolescence be farther ahead or closer?