News for hackers. Stuff that matters.
Re:Redline Smalltalk V1.0 by klibertp on Monday November 26, 2012 @12:11PM (#4832815)
JS has no "proper lexical scoping"? How so? I'm really curious... what your definition of "proper" is here, because JS definitely has lexical scoping.
Re:Redline Smalltalk V1.0 by jerf on Monday November 26, 2012 @12:30PM (#4832889)
Paste this into your browser location bar (it won't navigate away):

    javascript:void(function(){a = 1; {var a = 2;} alert(a)}())
That var a doesn't declare a new var within its scope, it declares it in the function, plus it is counterintuitive how that var a "retroactively" makes that local scope. Javascript has lexical scoping, but only within functions, not within all the scopes other languages have.
Re:Redline Smalltalk V1.0 by secoif on Monday November 26, 2012 @12:54PM (#4832991)
You want block scoping. Block scoping is coming in ES6 with the let keyword.
Re:Redline Smalltalk V1.0 by klibertp on Tuesday November 27, 2012 @06:39AM (#4836703)
Python is the same here, for example, any many other languages too. Making `a` a local variable here is rather ugly thing to do, but it's (somewhat) consistent with how `function` keyword (not an expression) works.

The point being: JS implements full and proper lexical scoping; implementing lexical scoping for every block is not a requirement for having lexical scoping.