Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!news.mixmin.net!news2.arglkargh.de!noris.net!newsfeed.arcor.de!newsspool3.arcor-online.net!news.arcor.de.POSTED!not-for-mail Content-Type: text/plain; charset="UTF-8" Message-ID: <39715420.plu8v4RzNR@PointedEars.de> From: Thomas 'PointedEars' Lahn Reply-To: Thomas 'PointedEars' Lahn Organization: PointedEars Software (PES) Date: Sat, 13 Oct 2012 23:49:59 +0200 User-Agent: KNode/4.4.11 Content-Transfer-Encoding: 8Bit X-Face: %i>XG-yXR'\"2P/C_aO%~;2o~?g0pPKmbOw^=NT`tprDEf++D.m7"}HW6.#=U:?2GGctkL,f89@H46O$ASoW&?s}.k+&. <1877322.0HhiMAB5S9@PointedEars.de> Followup-To: comp.lang.javascript MIME-Version: 1.0 Lines: 107 NNTP-Posting-Date: 13 Oct 2012 23:50:01 CEST NNTP-Posting-Host: db42ec5f.newsspool4.arcor-online.net X-Trace: DXC=eK@B8XYjY^ThSFhKO:mV;4J?F X-Complaints-To: usenet-abuse@arcor.de Xref: csiph.com comp.lang.javascript:16613 Patricia Shanahan wrote: > Thomas 'PointedEars' Lahn wrote: >> Patricia Shanahan wrote: >>> John G Harris wrote: >>>> Patricia Shanahan wrote: >>>> >>>>> According to the grammar in >>>>> http://www.ecma-international.org/ecma-262/5.1/, Statement can be >>>>> expanded to Block, so some blocks are statements. On the other hand, >>>>> there are contexts which require Block rather than Statement, for >>>>> example in a TryStatement. A block that appears where a statement is >>>>> not permitted cannot be a statement. >>>> >>>> >>>> I don't agree with your reasoning there. The standard says 'try' must >>>> be followed by a block statement. If it said that 'try' must be >>>> followed by (sic!) BTW, interrupting others in the midst of a sentence is not good quoting style either. >>> Could you give me a reference for where you are getting the phrase >>> "block statement"? >>> >>> I've searched both http://www.ecma-international.org/ecma-262/5.1/ and a >>> recently downloaded copy of >>> http://www.ecma-international.org/publications/files/ECMA >>> ST/Ecma-262.pdf, and without finding the phrase. Maybe there is some >>> other document I should be consulting. If so, please give me a pointer. >> >> Section "12.1 Block" of the ECMAScript Language Specification, 5.1 >> Edition (and all previous Editions; section numbering may differ) is a >> subsection of section "12 Statements". That, the productions for the >> /Statement/ goal symbol defined in the latter section – >> >> | Statement : >> | Block >> | VariableStatement >> | EmptyStatement >> | ExpressionStatement >> | IfStatement >> | IterationStatement >> | ContinueStatement >> | BreakStatement >> | ReturnStatement >> | WithStatement >> | LabelledStatement >> | SwitchStatement >> | ThrowStatement >> | TryStatement >> | DebuggerStatement > > I find it interesting that the symbol is "Block", not "BlockStatement". The goal symbol right-hand side is irrelevant, as the Specification is structured in sections so that it is clear what is a statement and what is not. And the goal symbol left-hand side emphasizes that. > Things that can only be used as a Statement, such as IfStatement, get > the word "Statement" in their symbols. Nonsense. >> specify that what can be produced from the Block goal symbol is >> considered a >> statement, or, IOW, that there is a Block statement. This may be >> colloquially written "block statement". > > You seem to be confused about my position. I am not saying that no Block > can be a Statement, just that a Block can be used in situations in which > a Statement would not be accepted, and so is not always a Statement. Ex falso quodlibet. A Block (statement) *cannot* be used in situations in which a Statement would not be accepted. For example, the braces in function x (y) { } are _not_ produced by /Block/, they are produced as part of | FunctionDeclaration : | function Identifier ( FormalParameterListopt ) { FunctionBody } The braces in var foo = { bar: 42 }; are _not_ produced by /Block/ either, they are produced as part of | ObjectLiteral : | { } | { PropertyNameAndValueList } | { PropertyNameAndValueList , } (formerly, /ObjectInitialiser/, and a trailing comma was a syntax error). PointedEars -- When all you know is jQuery, every problem looks $(olvable).