I think `box expr in place` is unnecessarily verbose. I also don't think `box(place) expr` will be confusing in practice, because it will presumably look something like `box(Gc) expr`, which should be pretty obvious that Gc is how it's being boxed, not what's being boxed.
-Kevin > On Dec 2, 2013, at 12:43 AM, Eric Reed <ecr...@cs.washington.edu> 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. > > > >> On Sun, Dec 1, 2013 at 6:31 AM, Tiffany Bennett <tiff...@stormbit.net> wrote: >> I agree with the `box` name, it's far less jarring than `new (1+1)`. >> >> >>> On Sun, Dec 1, 2013 at 9:06 AM, Tim Kuehn <tku...@cmu.edu> wrote: >>>> On Sun, Dec 1, 2013 at 8:04 AM, spir <denis.s...@gmail.com> wrote: >>> >>>>> On 12/01/2013 02:51 AM, Florian Zeitz wrote: >>>>> If I may chime in here. >>>>> I agree with Kevin that the different semantics of `new` are more likely >>>>> to create confusion, than alleviate it. >>>>> >>>>> Personally I would suggest calling this operator `box`, since it "boxes" >>>>> its argument into a newly allocated memory box. >>>>> >>>>> After all, these are different semantics from C++'s `new` (and also Go's >>>>> `make` AFAICT), therefore, presuming that a sigil is not a sufficient >>>>> indicator of a non-stack allocation, using an unprecedented keyword >>>>> seems the way to go to me. >>>> >>>> +++ to all 3 points >>>> >>>> Denis >>> >>> >>> I, too, am in favor of the `box` proposal. Short, intuitive, not >>> already commonly used. What's not to like? >>> >>> Cheers, >>> Tim >>> >>> >>> >>> >>>> >>>> _______________________________________________ >>>> 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 > > _______________________________________________ > 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