Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.javascript > #26101

Re: ECMAScript and classes

From Thomas 'PointedEars' Lahn <PointedEars@web.de>
Newsgroups comp.lang.javascript
Subject Re: ECMAScript and classes
Date 2014-11-08 19:11 +0100
Organization PointedEars Software (PES)
Message-ID <23998077.8isvcokmAf@PointedEars.de> (permalink)
References (1 earlier) <m25fv6$kmt$1@solani.org> <2243270.nPrEYIu7m9@PointedEars.de> <853i4a5opg36165ev602k2rhrsigpjlanl@4ax.com> <5228816.s9PhMjcOHp@PointedEars.de> <td9f5a9f08ameij4n0610eg187jj41suke@4ax.com>

Show all headers | View raw


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:
>>>>
>>>> <https://mail.mozilla.org/pipermail/es-discuss/2008-August/006837.html>
>>> 
>>> 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

<http://people.mozilla.org/~jorendorff/es6-draft.html#sec-class-definitions>

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: <http://PointedEars.de/faq> | SVN: <http://PointedEars.de/wsvn/>
Twitter: @PointedEars2 | ES Matrix: <http://PointedEars.de/es-matrix>
Please do not Cc: me. / Bitte keine Kopien per E-Mail.

Back to comp.lang.javascript | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

ECMAScript and classes John Harris <niam@jghnorth.org.uk.invalid> - 2014-10-21 10:49 +0100
  Re: ECMAScript and classes Gregor Kofler <usenet@gregorkofler.com> - 2014-10-21 12:25 +0200
    Re: ECMAScript and classes John Harris <niam@jghnorth.org.uk.invalid> - 2014-10-23 11:34 +0100
  Re: ECMAScript and classes "Christoph M. Becker" <cmbecker69@arcor.de> - 2014-10-21 13:27 +0200
    Re: ECMAScript and classes Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2014-10-21 19:27 +0200
      Re: ECMAScript and classes Stefan Weiss <krewecherl@gmail.com> - 2014-10-22 00:15 +0200
      Re: ECMAScript and classes "Christoph M. Becker" <cmbecker69@arcor.de> - 2014-10-23 14:45 +0200
      Re: ECMAScript and classes John Harris <niam@jghnorth.org.uk.invalid> - 2014-10-23 15:12 +0100
        Re: ECMAScript and classes Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2014-11-01 20:59 +0100
          Re: ECMAScript and classes John Harris <niam@jghnorth.org.uk.invalid> - 2014-11-03 15:56 +0000
            Re: ECMAScript and classes Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2014-11-08 19:11 +0100
              Re: ECMAScript and classes John Harris <niam@jghnorth.org.uk.invalid> - 2014-11-10 14:48 +0000
                Re: ECMAScript and classes Tim Streater <timstreater@greenbee.net> - 2014-11-10 15:54 +0000
                Re: ECMAScript and classes "Christoph M. Becker" <cmbecker69@arcor.de> - 2014-11-10 18:02 +0100
                Re: ECMAScript and classes John Harris <niam@jghnorth.org.uk.invalid> - 2014-11-11 11:08 +0000
                Re: ECMAScript and classes "Christoph M. Becker" <cmbecker69@arcor.de> - 2014-11-13 17:48 +0100
                Re: ECMAScript and classes John Harris <niam@jghnorth.org.uk.invalid> - 2014-11-13 20:32 +0000
                Re: ECMAScript and classes Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2014-11-10 23:03 +0100
                Re: ECMAScript and classes John Harris <niam@jghnorth.org.uk.invalid> - 2014-11-11 17:03 +0000
    Re: ECMAScript and classes John Harris <niam@jghnorth.org.uk.invalid> - 2014-10-23 14:58 +0100
      Re: ECMAScript and classes "Christoph M. Becker" <cmbecker69@arcor.de> - 2014-10-23 18:37 +0200
        Re: ECMAScript and classes John Harris <niam@jghnorth.org.uk.invalid> - 2014-10-24 11:30 +0100
          Re: ECMAScript and classes "Christoph M. Becker" <cmbecker69@arcor.de> - 2014-10-24 19:45 +0200
            Re: ECMAScript and classes John Harris <niam@jghnorth.org.uk.invalid> - 2014-10-26 10:43 +0000

csiph-web