On 11-07-14 6:08 AM, Marijn Haverbeke wrote:
First, a relatively non-controversial case:

auto&ccx = cx.fcx.lcx.ccx;   // Look ma, no refcounting bumps!

This case is very similar to alt/for blocks, and the alias checker
could check it with a relatively simple extension.

Next, of couse, I'm going to argue that 'accessing things through
blocks', for example the proposed hash table accessor approach (where
you pass a block to the accessor in which you'll have access to the
value) is an abomination, and we should allow functions to return
aliases to the content of their arguments. To the alias checker, this
isn't any more complicated than the alias-in-a-block case, and it is
certainly more pleasant on the programmer.

I like this part a lot. One of my pet peeves with rust has been the
impossibility of implementing something like

http://llvm.org/docs/doxygen/html/StringMap_8h_source.html

Where the strings are owned by the map. There a copy overhead when
first creating the map, but then the map is the only thing that needs
to be tracked/refcounted.

Thoughts?

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

Reply via email to