Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.mixmin.net!weretis.net!feeder1.news.weretis.net!news.solani.org!.POSTED!not-for-mail From: Thomas 'PointedEars' Lahn Newsgroups: comp.lang.javascript Subject: Re: ECMAScript and classes Date: Sat, 08 Nov 2014 19:11:11 +0100 Organization: PointedEars Software (PES) Lines: 91 Message-ID: <23998077.8isvcokmAf@PointedEars.de> References: <2243270.nPrEYIu7m9@PointedEars.de> <853i4a5opg36165ev602k2rhrsigpjlanl@4ax.com> <5228816.s9PhMjcOHp@PointedEars.de> Reply-To: Thomas 'PointedEars' Lahn Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8Bit X-Trace: solani.org 1415470277 484 eJwFwQERADEIAzBLsLXlkPPA8C/hE165OiAKXK729aRJ+ZW8gZqcSlUo9hRwYf5kTevzyB8mlxEF (8 Nov 2014 18:11:17 GMT) X-Complaints-To: abuse@news.solani.org NNTP-Posting-Date: Sat, 8 Nov 2014 18:11:17 +0000 (UTC) User-Agent: KNode/4.14.2 X-User-ID: eJwVyMERgDAIBMCWQsJxUo4C138J6sy+Ficsih4Ih6ApKcb2NjK5Sinh+YK9x/Net04Hm44BCOsr9XNhlecLZPAVkw== Cancel-Lock: sha1:oZx0sAiZ/tB8i8zUzwkUpRpsuSo= X-NNTP-Posting-Host: eJwVyMERwDAIA7CVkga7YR0w3n+EXvUUDjf7DYIBw+zrCfeSHqTG0QUdwqocZejuqL969RQ/QqQSjg== Xref: csiph.com comp.lang.javascript:26101 John Harris wrote: > Thomas 'PointedEars' Lahn wrote: >> John Harris wrote: >>> Thomas 'PointedEars' Lahn wrote: >>>> That Edition 6 might (I daresay, probably will) re-introduce classes in >>>> some way appears to be the result of the Harmony agreement: >>>> >>>> >>> >>> Replace >>> "re-introduce classes" >>> by >>> "re-introduce *support* for classes". >> >> There is a “class” keyword (which was therefore a “future reserved word” >> until then [1]), and the parts of the code that it declares *are* classes >> in that language: > > No, no, no! The source code is not a class : it is a class > *definition*. Tetrapilotomy. At the latest, when the source code in question is compiled, or the class identifier is first used, the class definition results in the creation of a class. It may even result in the creation of a class object. > The difference between a class and its definition is > important and needs to be understood. Your logic is flawed. A class definition defines a class, which implies existence of the concept of a class. > You say of an object, aka instance, that it belongs to a certain class > and that it is described by a certain class definition. True, but irrelevant. >>> But not full support it appears. >> >> That depends on how you define “class”. The same as it is unreasonable >> to define OOP solely by the features of OOP present in, e.g., Java, it is >> unreasonable to define “class” only as it is used elsewhere, and then >> deny the existence of “classes” or “full support for classes” in an >> (draft) Edition of ECMAScript. > > A language where class instances have no instance data is so > restrictive that I don't believe anyone would pay money to use it. What do you mean by “class instance” and “instance data”? > Therefore it seems to me that instance properties are a sine qua non > and not describing them in the class definition is clearly a lack of > support. If you mean “instance of a class” and “data/properties of an instance“, respectively, then /ex falso quodlibet/ applies. How did you get the idea that those instances could not hold data/have properties? And how did you get the idea that one would have to pay for using an implementation of ECMAScript? > However, if you insist it is not a lack then neither is a lack of a > 'class' keyword. A special comment such as /*** Class ***/ would do > instead. Therefore you must stop saying that ES5 and earlier do not > have classes. Although programming languages are designed for people and their identifiers are usually semantic, it is true that my argument does not hold that a “class” keyword in the grammar of a programming language implies support for classes there. However, that this keyword is listed under the heading “Classes” of a normative section of a Specification or documentation for that language does. Therefore, it is correct to say today that there is a possible future Edition of ECMAScript that is going to support classes, and there are several implementations of a past draft of an Edition of ECMAScript that do support classes. I have referred to that past draft and implementation documentation before; the relevant section of the draft for the future Edition is available at Those are the specification of class definitions for classes in ECMAScript (implementations); they may be different from what is understood as a “class” elsewhere, but that is irrelevant. Therefore, it is illogical to deny the existence and support of classes in the former languages. -- PointedEars FAQ: | SVN: Twitter: @PointedEars2 | ES Matrix: Please do not Cc: me. / Bitte keine Kopien per E-Mail.