On Fri, 11 Nov 2016 12:37:08 +0100, Thomas 'PointedEars' Lahn
<
Point...@web.de> wrote:
>John Harris wrote:
>
>> […] Thomas 'PointedEars' Lahn […] wrote:
>>> There are no pointers in these languages (except in the low-level
>>> implementation). The proper term is _reference_.
>>
>> Unfortunately, ECMA 262 uses 'reference' with several different
>> meanings.
>
>ECMA-262 is irrelevant in that regard. This is a term borrowed from Java,
>which JavaScript was designed to resemble, and therefore applicable to all
>ECMAScript implementations;
This is a policy that will lead to considerable confusion.
When you, Thomas, write 'property' must we assume you mean a
Java-style property (which is different from an ECMAScript property)?
When you write that a variable's value is an 'integer' must we assume
you mean a 32 bit Java-style integer (which is not an ECMAScript user
type)?
> a term that is used in various object-oriented
>programming languages (including those that are not implementations of
>ECMAScript).
In C++ a reference variable has a meaning that is different from the
one you are using.
>“Reference” is to be understood as “reference to an object”. For in those
>languages there can be multiple properties referring to the same object, all
>having the same value – a reference to that object –, and that object can be
>marked for garbage collection if there are no more references to it.
a) As primitive strings cannot be altered the compiler is allowed to
use a copy-on-write strategy for them. When it does this, the property
value will be implemented as a Java-style reference. So it's not just
"to an object".
b) ECMA 262 does not require that when a property holds an object it
must be implemented as a Java-style reference or pointer. Equally, it
does not prohibit it. Indeed, if two variables hold the same object
the use of pointers, alias references, is very likely; in which case
it might as well be used when there is only one such variable, but it
is *not* a conformance requirement.
c) ECMA 262 does not require a garbage collector, but, as usual,
allows it.
>> The only use of the word with Thomas's meaning is in
>> informal (non-normative) sections and notes. The formal meaning is
>> defined in Section 6.2.3. It is a rather complicated kind of pointer
>> to a property; it is NOT the *value* of the property.
>
>Utter nonsense.
Are you saying that Section 6.2.3 does not exist? Are you saying that
there is no need for ECMA 262 to define a GetValue specification
function for ECMAScript references?
Yes to either would suggest you've gone doolally.
>> Therefore
>> "The proper term is _reference_."
>> should be changed to
>> "The proper term is _reference_ (informal meaning)."
>
>No, it should not.
Obviously it should.
John