[rust-dev] "let mut" <-> "var"
space.ship.traveller at gmail.com
Wed Jan 29 19:21:33 PST 2014
Whoops, my bad, let x = 10 (should be easier to optimise) :D
On 30 January 2014 16:20, Samuel Williams <space.ship.traveller at gmail.com>wrote:
> What about constant folding? Surely let mut x = 10 is easier for the
> compiler to optimise?
> On 30 January 2014 16:18, Daniel Micay <danielmicay at gmail.com> wrote:
>> On Wed, Jan 29, 2014 at 10:09 PM, Samuel Williams
>> <space.ship.traveller at gmail.com> wrote:
>> > I agree that it is syntactic salt and that the design is to discourage
>> > mutability. I actually appreciate that point as a programmer.
>> > w.r.t. this specific issue: I think what concerns me is that it is
>> quite a
>> > high burden for new programmers (I teach COSC1xx courses to new
>> students so
>> > I have some idea about the level of new programmers). For example, you
>> > to know more detail about what is going on - new programmers would find
>> > difficult as it is one more concept to overflow their heads.
>> Either way, Rust is going to warn when there is unnecessary mutability.
>> > Adding "var" as a keyword identically maps to new programmer's
>> > problems right?
>> > But, could be optimised more (potentially) if using "let" for immutable
>> It really doesn't introduce any potential optimizations.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Rust-dev