Hi,

I'm new to Rust, currently trying out a few simple tests to get a
handle on things.

I have a few questions about linked lists. I see there are two list
modules in extra, one for ~ pointers and one for @ pointers. (I'm
using the current trunk rather than 0.7 if that makes a difference.)

The interfaces between the two look quite different however. Is this
because one is newer and the other hasn't caught up yet, or are the
differences by design and the two interfaces will stay more or less as
they are?

In extra::list, I don't see methods to append or remove a single
element. Intentional or todo?

In extra::dlist, there are methods to remove the back or front
element, but not an arbitrary link?

On a related note, I'd be interested to read about implementing data
structures in Rust. The examples of structs in the tutorial are mostly
very simple (Point, Circle, etc). The use of Rust's pointers get much
more complicated when dealing with non-tree structures. For example,
extra::dlist uses raw pointers rather than @ pointers for links. An
overview of what the tradeoffs look like (code clarity,
memory-leak/memory-corruption issues, performance numbers, memory
usage) and some cookbook patterns could be quite helpful.

Thanks,
-Nicholas
_______________________________________________
Rust-dev mailing list
Rust-dev@mozilla.org
https://mail.mozilla.org/listinfo/rust-dev

Reply via email to