Suggestion: dynamic array operations

Steve Horne stephenwantshornenospam100 at aol.com
Fri Sep 8 09:15:58 PDT 2006


On Fri, 08 Sep 2006 09:48:36 -0400, nobody <nobody at mailinator.com>
wrote:

>Accessing a pointer to a value requires just the pointer. Accessing an array 
>element requires a pointer and an offset. Accessing a list element requires a 
>pointer and a depth.

Disagree. Accessing a list element requires a list position. That
could be as simple as an iterator - a pointer, IOW. If I was going to
subscript into a container, I probably wouldn't use a linked list.

>These are all great examples of how one might use a basic list structure. I had 
>the Lisp cons cell in mind and was apparently expecting you to discover that via 
>ESP -- another great feature D will probably never have. The cons cell as I was 
>imagining it has room for two pointers. The first is usually known as the car of 
>the list and the second is the cdr:
>
>   http://en.wikipedia.org/wiki/Car_and_cdr

I've Lisped in a past life, though not much. I dunno, though. After
all, it's a low level tool - not a high level container. When a tool
can do anything, its not always clear what it's supposed to be doing,
so you won't be told when you're doing it wrong.

But then, it is just a struct with two pointers.

-- 
Remove 'wants' and 'nospam' from e-mail.



More information about the Digitalmars-d mailing list