From: John G Harris on 25 May 2010 10:49 On Mon, 24 May 2010 at 13:33:59, in comp.lang.javascript, Garrett Smith wrote: >On 5/24/2010 12:04 PM, John G Harris wrote: >> On Mon, 24 May 2010 at 07:30:46, in comp.lang.javascript, Ry Nohryb >> wrote: >> >> <snip> >>> No, no one but Smith is wrong : his statement is obviously false: "in >>> ECMAScript, a ` FunctionDeclaration ` cannot appear as a Statement" is >>> FALSE. >> <snip> >> >> If he changed it slightly to >> >> "in ECMAScript a FunctionDeclaration cannot appear everywhere that a >> Statement can appear." >> >> then it would be completely accurate and true. >> > >How about: >| in ECMAScript a FunctionDeclaration is not a Statement; it cannot >| appear everywhere that a Statement can. Also completely accurate and true, and better. John -- John Harris
From: John G Harris on 25 May 2010 11:33 On Mon, 24 May 2010 at 14:14:45, in comp.lang.javascript, Asen Bozhilov wrote: <snip> >FunctionStatement does not provide any syntactical differences with >FD. But provides differences during instantiation stage. Function >Declarations are instated on entering on execution context, but >Function Statements during evaluation of the statement in which they >are defined. <snip> Which definition of FunctionStatement are you using? Definition A, which hasn't been published; or definition B, which also hasn't been published? When a term has no single published definition you need to say what you mean. Otherwise you are guaranteed to be wrong by somebody's definition. John -- John Harris
From: Ry Nohryb on 25 May 2010 12:08 On May 25, 4:49 pm, John G Harris <j...(a)nospam.demon.co.uk> wrote: > On Mon, 24 May 2010 at 13:33:59, in comp.lang.javascript, Garrett Smith > > >How about: > >| in ECMAScript a FunctionDeclaration is not a Statement; it cannot > >| appear everywhere that a Statement can. > > Also completely accurate and true, and better. If you mean a statement, as in : A.4 Statements: Block VariableStatement EmptyStatement ExpressionStatement IfStatement IterationStatement ContinueStatement BreakStatement ReturnStatement WithStatement LabelledStatement SwitchStatement ThrowStatement TryStatement, I'm not sure. What would be an example ? A piece of code with a spot in which you could put any statement but not a function declaration ? -- Jorge.
From: Johannes Baagoe on 25 May 2010 12:35 Garrett Smith : > How about: > | in ECMAScript a FunctionDeclaration is not a Statement; it cannot > | appear everywhere that a Statement can. English is not my mother tongue, but I choke on "everywhere that", plain "everywhere" would seem to be enough. I also fear a logical ambiguity. Does it mean "There is at least one place in which a Statement can appear and a FunctionDeclaration cannot", or "Everywhere a Statement can appear, a FunctionDeclaration cannot"? -- Johannes
From: Garrett Smith on 25 May 2010 13:54
On 5/25/2010 9:35 AM, Johannes Baagoe wrote: > Garrett Smith : > >> How about: >> | in ECMAScript a FunctionDeclaration is not a Statement; it cannot >> | appear everywhere that a Statement can. > > English is not my mother tongue, but I choke on "everywhere that", plain > "everywhere" would seem to be enough. > > I also fear a logical ambiguity. Does it mean "There is at least one place > in which a Statement can appear and a FunctionDeclaration cannot", or > "Everywhere a Statement can appear, a FunctionDeclaration cannot"? > | in ECMAScript a FunctionDeclaration is not a Statement; there are | places where a Statement may appear and a FunctionDeclaration may not. It might be acceptible to use just that and drop the first part of the sentence it was in. | The term "function statement" has been widely and wrongly used to | describe a FunctionDeclaration. This is misleading because in | ECMAScript, a FunctionDeclaration is not a Statement; there are | places where a Statement may appear and a FunctionDeclaration may not. | | To add to this confusion, some implementations, including Mozillas', | provide a syntax extension called function statement. This is allowed | under section 16 of ECMA-262, Editions 3 and 5. I changed "notably Mozillas'" to "including Mozillas'" to indicate that there are others, without having to spell out a list of blackberry, Safari versions, etc. The point is that "function statement" doesn't mean what most think it means; function statement is a syntax extension and best avoided by using either FunctionDeclaration or FunctionExpression. |