Re: [rust-dev] Proposal: Eliminate let hoisting

2011-08-10 Thread Graydon Hoare
On 11-07-31 09:23 AM, Patrick Walton wrote: So I should have been more clear -- in this scheme local variables would be the only non-hoisted bindings. It's rare that local variables need to be mutually recursive; the only time is when you want mutually recursive capturing lambdas, and in that

Re: [rust-dev] Proposal: Eliminate let hoisting

2011-07-31 Thread Marijn Haverbeke
What I've been doing in these situation is just not passing bcx by alias. Then you have a regular, mutable local. As an unrepentant Lisper, I wouldn't be opposed to let introducing a new scope (that is, in fact, how Hob works), but I don't think it fits really well in the c heritage that we're

Re: [rust-dev] Proposal: Eliminate let hoisting

2011-07-31 Thread Patrick Walton
On 7/31/11 9:11 AM, Brendan Eich wrote: JS already has function hoisting, which wins for programming in top-down style, maintaining source without having to topologically sort functions, etc. I made functions hoist to top of program or outer function body to mimic letrec, way back in the

Re: [rust-dev] Proposal: Eliminate let hoisting

2011-07-31 Thread Brendan Eich
On Jul 31, 2011, at 9:23 AM, Patrick Walton wrote: Rust always hoists function items (named functions), even nested ones. I think that's a great feature for the reasons you describe -- it gets rid of having to think about the function dependency DAG, which is a big pain in C and C++, and