On Mon, Sep 02, 2013 at 04:37:34PM -0700, Tim Chevalier wrote:
> There are two list modules because one is a singly linked list --
> list.rs -- and one is a doubly linked list -- dlist.rs . Off the top
> of my head I'm not sure if there's a reason why list.rs uses @
> pointers.

The reason that list uses `@` pointers is because it is indended to
serve as the venerable "cons-list" data structure found in Lisp and
many functional languages. The real advantage of this data structure
is that it is persistent, meaning you can prepend items to the list
without modifying the old copies of the list. To make this convenient,
garbage collection is required. If you only have one copy of the list,
you might as well use a `~[]` vector.


Niko
_______________________________________________
Rust-dev mailing list
[email protected]
https://mail.mozilla.org/listinfo/rust-dev

Reply via email to