Path: csiph.com!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!newsreader4.netcologne.de!news.netcologne.de!newsfeed.arcor.de!newsspool3.arcor-online.net!news.arcor.de.POSTED!not-for-mail Content-Type: text/plain; charset="UTF-8" Message-ID: <1501663.2MW88XEVCj@PointedEars.de> From: Thomas 'PointedEars' Lahn Reply-To: Thomas 'PointedEars' Lahn Organization: PointedEars Software (PES) Date: Mon, 15 Oct 2012 01:17:29 +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> <39715420.plu8v4RzNR@PointedEars.de> <30008540.2uy7m7UenZ@PointedEars.de> <1d2dnaYwft6OxOfNnZ2dnUVZ_rWdnZ2d@earthlink.com> Followup-To: comp.lang.javascript MIME-Version: 1.0 Lines: 58 NNTP-Posting-Date: 15 Oct 2012 01:17:30 CEST NNTP-Posting-Host: 8d398120.newsspool4.arcor-online.net X-Trace: DXC=FU5j\:6Q_mYU6b:FjPaGjQ4IUKKPGO;FOAbOea]U[Q2c2aV^7^ X-Complaints-To: usenet-abuse@arcor.de Xref: csiph.com comp.lang.javascript:16639 Patricia Shanahan wrote: > Thomas 'PointedEars' Lahn wrote: >> Patricia Shanahan wrote: >>> Have you considered the TryStatement productions? >> >> I have, and that is indeed a case where any other statement but a Block >> statement is not allowed. However, that does not prove your argument, >> only its premise. > > In that case, we may have to just agree to differ. You seem to have a > very deeply built-in assumption that a Block must be a Statement, to the > extent that even when discussing the standard you talk about "a Block > statement", a phrase that does not appear in it, rather than terms such > as "a Block" or "a Block of code", that do appear in the standard. For crying out loud. When something is specified in a subsection of the main section titled "Statements", and any other subsection of that section specifies a different statement; when it is directly produced by the /Statement/ goal symbol as all other direct results of that production that are defined in the same main section, then it is not very far-fetched to assume that this something is meant to be a statement as well. Indeed, it is not logical to assume that the opposite is the case. But, as they say, the proof is in the pudding. If what is produced by the /Block/ production would not be a statement, then { 42 } would not be a syntactically valid ECMAScript /Program/, because it cannot be produced by anything other than the production chain /Program/ → /SourceElements/ → /SourceElement/ → /Statement/ → /Block/ → { /StatementList/ } → { /Statement/ } → { /ExpressionStatement/ } → … → { 42 } You will observe, however, that this code compiles in all conforming implementations without syntax error, and that the result of that /Program/ is 42, because the result of the /Block/ statement is 42, because the result of the /ExpressionStatement/ 42 is, necessarily, 42. Which is what the production rules specify. QED. PointedEars -- > If you get a bunch of authors […] that state the same "best practices" > in any programming language, then you can bet who is wrong or right... Not with javascript. Nonsense propagates like wildfire in this field. -- Richard Cornford, comp.lang.javascript, 2011-11-14