Fwd: local variables with inherited values

2013-12-25 Thread raul mihaila
What I want is both similar to A2 and B2, but it's different in that there is only 1 scope for the inner variable. The inner variable is just a local variable, but it's initialized in the hoisting process with the value from the outer scope. Initially I was thinking only about var scoped variables

Re: local variables with inherited values

2013-12-25 Thread raul mihaila
On Tue, Dec 24, 2013 at 7:53 PM, Brendan Eich bren...@mozilla.com wrote: ES4 had let (x = x) ... forms (where ... was an expression or a body), but for ES6 we agreed on the temporal dead zone: Or maybe there's no need for a new keyword :). Not sure I would like an additional body though.

Re: es-discuss Digest, Vol 82, Issue 95

2013-12-25 Thread raul mihaila
@Alex Kocharin: I would't call the functions like time. It was only a very simple example. Often my functions would be called from outside so I wouldn't be able to pass the values. Also the main reason I want this is for optimizations, so as you pointed out, can't use the ugly with. On Tue, Dec

Re: es-discuss Digest, Vol 82, Issue 95

2013-12-25 Thread Alex Kocharin
 If you're looking for optimizations, nested closures is not a place where you generally want to be. Create a function out of the scope and call it with all needed variables since function calling is cheap nowadays, and arguments already behave the way you're describing.  25.12.2013, 15:29, "raul

Overly complicated Array.from?

2013-12-25 Thread David Bruant
Hi, I was reading the current spec for Array.from and it felt too complicated to me. Currently, at a high-level it reads like: 1) if the argument is iterable (@@iterable symbol), create a fresh array made of the values iterated on with the iterator 2) (step9) if the object is array-like, len =

Re: Overly complicated Array.from?

2013-12-25 Thread Rick Waldron
On Wed, Dec 25, 2013 at 7:33 PM, David Bruant bruan...@gmail.com wrote: Hi, I was reading the current spec for Array.from and it felt too complicated to me. I've been following the specification of Array.from very closely since the day Dave and I first designed it and it's exactly as