On 30.11.2013 23:50, Patrick Walton wrote:
> Right, I agree with this. Kevin's argument that C++ "new" has different
> behavior is valid though, and makes me conflicted.
> 
> BTW, I was thinking about "make" as well. Go is precedent that both
> "new" and "make" can coexist (though not without controversy...) Old
> Rust used to use "mk" as the constructor convention.
> 
> Patrick
> 

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.

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

Reply via email to