Re: [rust-dev] Auto-borrow/deref (again, sorry)

2013-12-28 Thread Kevin Ballard
We have to say `mut i` in main() because `i` is non-mutable. We’re explicitly taking a mutable borrow. But once it’s in foo(), it’s already mutable. The type `mut int` carries its mutability with it. Having to say `mut` again makes no sense and is nothing but pure noise. -Kevin On Dec 27,

[rust-dev] Using libgreen/libnative

2013-12-28 Thread Alex Crichton
Greetings rusticians! Recently pull request #10965 landed, so the rust standard library no longer has any scheduling baked into it, but rather it's refactored out into two libraries. This means that if you want a 1:1 program, you can jettison all M:N support with just a few `extern mod`

Re: [rust-dev] Auto-borrow/deref (again, sorry)

2013-12-28 Thread Ashish Myles
I think I see the confusion (as I suffered from the same point of confusion). So let me restate your answer and please correct me of I am wrong. 1. mut int and mut int are different types and the former doesn't automatically convert to the latter. 2. The way to get the latter from the former is

Re: [rust-dev] Auto-borrow/deref (again, sorry)

2013-12-28 Thread Kevin Ballard
On Dec 28, 2013, at 1:53 PM, Ashish Myles marci...@gmail.com wrote: I think I see the confusion (as I suffered from the same point of confusion). So let me restate your answer and please correct me of I am wrong. 1. mut int and mut int are different types and the former doesn't

Re: [rust-dev] Using libgreen/libnative

2013-12-28 Thread Huon Wilson
This is awesome! I have a question: does the #[boot] addition mean that we now have 5 ways to (partially) set-up the entry point of a program? - fn main - #[main] - #[start] - #[boot] - #[lang=start] Huon On 29/12/13 05:37, Alex Crichton wrote: Greetings rusticians! Recently pull

Re: [rust-dev] Auto-borrow/deref (again, sorry)

2013-12-28 Thread Vadim
Right, that's how it works now. But I was speculating on how it could work with auto-borrow. Specifically, I was addressing comex's concern that C++-like reference auto-borrowing would make it non-obvious when the callee might mutate the value. You could have said Well, I've already declared

Re: [rust-dev] Using libgreen/libnative

2013-12-28 Thread Brian Anderson
On 12/28/2013 04:12 PM, Huon Wilson wrote: This is awesome! I have a question: does the #[boot] addition mean that we now have 5 ways to (partially) set-up the entry point of a program? - fn main - #[main] - #[start] - #[boot] - #[lang=start] Yeah, pretty much, and there's also a 6th way

Re: [rust-dev] Using libgreen/libnative

2013-12-28 Thread Brian Anderson
Thanks for writing this up, Alex. The improvements you've made to the runtime recently are very impressive. Now we've got nearly complete and reasonably fast I/O, fast message passing, a scheduler-agnostic standard library, and very soon an embeddable runtime and a standard library that can be

Re: [rust-dev] Auto-borrow/deref (again, sorry)

2013-12-28 Thread Kevin Ballard
On Dec 28, 2013, at 7:10 PM, Vadim vadi...@gmail.com wrote: You could have said Well, I've already declared my variable as mutable, i.e. `let mut i = 0`. Since is already mutable, why do I have to say mut again when borrowing? The compiler could have easily inferred that. I believe the