Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!news.internetdienste.de!noris.net!newsfeed.arcor.de!newsspool1.arcor-online.net!news.arcor.de.POSTED!not-for-mail Content-Type: text/plain; charset="UTF-8" Message-ID: <3158186.8TiyjIphOr@PointedEars.de> From: Thomas 'PointedEars' Lahn Reply-To: Thomas 'PointedEars' Lahn Organization: PointedEars Software (PES) Date: Tue, 28 May 2013 21:14:39 +0200 User-Agent: KNode/4.10.2 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+&. <1639100.PjNAD8PV0k@PointedEars.de> <8f4997a5-cb1c-4d4c-961e-c88226531c6d@cl9g2000vbb.googlegroups.com> <2307387.pZyV4EZjM8@PointedEars.de> <7bbd3b78-c201-4ac4-98b6-77a3d270c807@fv8g2000vbb.googlegroups.com> <2788472.6QvGpzPONO@PointedEars.de> <5260436.L7RB4VL119@PointedEars.de> <025995e5-77c4-42e0-9c2d-60607ed970e9@2g2000yqr.googlegroups.com> MIME-Version: 1.0 Lines: 97 NNTP-Posting-Date: 28 May 2013 21:14:41 CEST NNTP-Posting-Host: d3cbec03.newsspool1.arcor-online.net X-Trace: DXC=_D96JlaLjlD@k=MdN::NBIic==]BZ:afN4Fo<]lROoRAnkgeX?EC@@@:B3KFXJVReBDZm8W4\YJNLb@mF9jNikdEBoKGPB=12AGMN:Yf7> John Harris wrote: >> Scott Sauyet wrote: >> >>> >>> >>> >>> In all browsers I tested, the programs displayed different behavior, >>> even though the two programs are identical except that one expression >>> has been replaced by an equivalent one in the second. >> >> >> Name the functions in the two examples f and g to lessen the >> confusion. > > That would only confuse the point. The point is that the only > difference between the two programs is the substitution of `0` in the > second for the equivalent `+!1` in the first. Nonetheless the two > programs have different behavior. Making an additional change by > changing the name of the function would muddy the waters. You are the one who is muddying the waters here. The point is that you continue to fail to differentiate between A) an expression and B) the string representation of the function that contains it. The expression is evaluated to the return value of the function by the *compiler/interpreter* not before the function is *called*; its equivalence to another expression in that context means that the evaluation of the expression for the return value results in the same (identical) value. In short, the return values of the functions are the same, therefore the expressions leading to the return values are (value-)equivalent and the functions are functional equivalent. The functions themselves are obviously not value-equivalent per se (as indicated by the possibility of different string representations), but then again nobody but you claimed they should. It is that difference, and that change of context involved, that you fail to comprehend, and that you ignore so that you can make the knee-jerk statement of a “reduced usefulness” of the textbook definition of (expression) equivalence. >> You are saying that when f() and g() are 'equivalent' expressions >> then f.toString() should be 'equivalent' to g.toString() for >> equivalence to be a useful concept. > > Not at all. Yes, you are. > The real point is that the equivalence of expressions is less useful > in Javascript than in many other languages. ^^^^^^^^^^ Utter nonsense, twofold. Assuming “Javascript” as a misnomer for “ECMAScript implementations”, you of all people should know that those languages are not the only languages in which functions are first-class objects. It is negatively surprising to me how little you understand both ECMAScript implementations and pure functional programming languages, yet you are attempting to implement – unnecessarily – “functional programming” in ECMAScript. > Automatic minification based upon it can break programs that take > advantage of this weird quirk of the language. Perhaps the only answer is > Thomas' assertion that, "ECMAScript programs which rely on function > serialization are deeply flawed." But this does mean that automated > minification can possibly wreak havoc with certain code. Yes, and it means that you have still not understood the not-that-difficult concept of equivalence (of expressions in a computer program). > > The equivalence of expressions is not the same as the equivalence of > > objects. > > Shame on you; I think you've been listening to Thomas. :-) […] How many people explaining to you that you are wrong does it take before you can see that you are wrong? | Have you never, even once, considered the possibility that someone who | disagrees might understand the subject in as much depth as you do and | still have reached a different conclusion? – Scott Sauyet in Probably you are either not smart enough for this, or you are trolling. -- PointedEars Twitter: @PointedEars2 Please do not Cc: me. / Bitte keine Kopien per E-Mail.