I think the idea was to have the syntax desugar into method calls just like
other existing operators.
There'd be a trait like:

trait Box<T> {
    fn box(val: T) -> Self
}

and something like "box expr in place" would desugar into
"place::box(expr)".

One question this poses is why are we requiring the "place" to be specified
all the time?
Why not let type inference handle deciding the "place" most of the time?


On Mon, Dec 2, 2013 at 10:46 AM, Erick Tryzelaar
<erick.tryzel...@gmail.com>wrote:

> Is there any way we can use a method and move semantics for this? This
> feels pretty natural to me:
>
> let foo = gc_allocator.box(bar);
>
>
> On Mon, Dec 2, 2013 at 10:23 AM, Patrick Walton <pwal...@mozilla.com>wrote:
>
>> Anything with @ feels like it goes too close to pointer sigils for my
>> taste.
>>
>> Patrick
>>
>> spir <denis.s...@gmail.com> wrote:
>>>
>>> On 12/02/2013 11:57 AM, Kevin Ballard wrote:
>>>
>>>> With @ going away another possibility is to leave ~ as the normal 
>>>> allocation operator and to use @ as the placement operator. So ~expr stays 
>>>> the same and placement looks either like `@place expr` or `expr@place`
>>>
>>>
>>>
>>> I like that, with expr@place. Does this give:
>>>  let foo = ~ bar;
>>>  let placed_foo = bar @ place;
>>> ?
>>>
>>> Yet another solution, just for fun, using the fact that pointers are 
>>> supposed to
>>> "point to":
>>>
>>>
>>>  let foo = -> bar;
>>>  let placed_foo = bar -> place;
>>>
>>> Denis
>>> ------------------------------
>>>
>>> Rust-dev mailing list
>>> Rust-dev@mozilla.org
>>> https://mail.mozilla.org/listinfo/rust-dev
>>>
>>>
>> --
>> Sent from my Android phone with K-9 Mail. Please excuse my brevity.
>>
>> _______________________________________________
>>
>> Rust-dev mailing list
>> Rust-dev@mozilla.org
>> https://mail.mozilla.org/listinfo/rust-dev
>>
>>
>
> _______________________________________________
> Rust-dev mailing list
> Rust-dev@mozilla.org
> https://mail.mozilla.org/listinfo/rust-dev
>
>
_______________________________________________
Rust-dev mailing list
Rust-dev@mozilla.org
https://mail.mozilla.org/listinfo/rust-dev

Reply via email to