Re: function hoisting like var

2008-07-26 Thread Brendan Eich
On Jul 26, 2008, at 4:03 AM, Ingvar von Schoultz wrote: [EMAIL PROTECTED] wrote: Ingvar von Schoultz wrote: [EMAIL PROTECTED] wrote: I'm trying to keep the language relatively simple. You can't get away from supporting this: { function a(){} var b = a; } What do

Re: function hoisting like var

2008-07-26 Thread Ingvar von Schoultz
Igor Bukanov wrote: 2008/7/26 Ingvar von Schoultz [EMAIL PROTECTED]: Do you really think {{ }} appears in existing code, correctly enclosing statement blocks, with the {{ and the }} placed tightly together both at the beginning and at the end? Yes: I have seen the code like if (x) {

Re: function hoisting like var

2008-07-26 Thread Ingvar von Schoultz
Brendan Eich wrote: Waldemar meant precisely what he wrote: ES3 and draft ES3.1 -- the specifications, not random JS implementations. Oops, I got lost in details and strayed far away from the point that I wanted to make. In fact I should have said this from the beginning: You can't get away

Re: function hoisting like var

2008-07-26 Thread Igor Bukanov
2008/7/26 Ingvar von Schoultz [EMAIL PROTECTED]: I think all of these would be unambiguous: {. code .} {. not work since {.0; } is a valid ES3 {: code :} {| code |} These 2 cases are indeed invalid ES3. {[ code ]} [[ code ]] [ code ] Any of this can be a valid

Re: function hoisting like var

2008-07-26 Thread Brendan Eich
On Jul 26, 2008, at 2:07 PM, Ingvar von Schoultz wrote: You can't get away from supporting this: { function a(){} var b = a; } ES4 is planning to support function declarations locally bound in blocks, so the above is valid ES4 code. What you see above is

Re: function hoisting like var

2008-07-26 Thread Brendan Eich
On Jul 26, 2008, at 2:06 PM, Ingvar von Schoultz wrote: How sad! It seemed such a simple and intuitive notation! Opinions vary, but all the ones I heard at the Ecma TC39 meeting found it neither simple nor intuitive, and some abhorred it on aesthetic grounds to boot. I think all of these

Re: function hoisting like var

2008-07-26 Thread Ingvar von Schoultz
Sorry about the length of this, but I'm trying to cover the unclear things, and often I don't know which things are unclear. Brendan Eich wrote: On Jul 26, 2008, at 2:07 PM, Ingvar von Schoultz wrote: You can't get away from supporting this: { function a(){} var