On 11/30/2013 11:24 AM, György Andrasek wrote:
On 11/30/2013 09:34 AM, Patrick Walton wrote:
IMHO sigils made sense back when there were a couple of ways to allocate
that were built into the language and there was no facility for custom
smart pointers. Now that we have moved all that stuff into the library,
sigils seem to make less sense to me


What really bugs me about `~` is that it conflates the idea of lifetime and
ownership (which is a zero-cost annotation) with allocation (which is an actual
expensive operation to stay away from). This wasn't a problem with `@`, but it's
gone now.

My choice would be to keep `~` in types, but use `new` for allocation:

     let foo: ~Foo = new Foo(bar);

Looks quite nice :-) and nicely separates syntax items for "kind of pointing" and "watch, runtime mem alloc ahead!". (However, as others have noted, 'new' in itself means nothing; for non-C++-ers like myself, a proper term would be better.)

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

Reply via email to