On 12/02/2013 09:43 AM, Eric Reed wrote:
I think the 'new(place) expr' or 'box(place) expr' is pretty confusing
syntax. To me, it's not at all clear that "new(varA) varB" means "eval varB
and put it into varA" instead of "eval varA and put it into varB".
I'd much prefer syntax that makes it very clear which is the expression and
which is the place. Personally, I like ~ so I'd like "~expr in place", but
if people absolutely insist on scrapping ~ then I'd suggest "put expr in
place".
In either case, I think keeping ~ as sugar for allocating on the exchange
heap would be nice (i.e. "~expr" is sugar for "~expr in Unique" or "put
expr in Unique").
I guess we could use "new" or "box" instead of "put", but I like "put" over
either.

What about:
        box(place, expr)
        box(expr, place)        # better for me
        box expr in/to place    # pure syntactic magic
? The latter may seem weird, but anyway box or new or whatever aren't functions in the ordinary sense.

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

Reply via email to