Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.javascript > #38247 > unrolled thread
| Started by | John G Harris <niam@jghnorth.org.uk.invalid> |
|---|---|
| First post | 2020-03-16 14:34 +0000 |
| Last post | 2020-03-23 18:49 -0700 |
| Articles | 20 on this page of 76 — 12 participants |
Back to article view | Back to comp.lang.javascript
Object values (continued) John G Harris <niam@jghnorth.org.uk.invalid> - 2020-03-16 14:34 +0000
Re: Object values (continued) Jon Ribbens <jon+usenet@unequivocal.eu> - 2020-03-16 14:52 +0000
Re: Object values (continued) John G Harris <niam@jghnorth.org.uk.invalid> - 2020-03-16 18:19 +0000
Re: Object values (continued) Jon Ribbens <jon+usenet@unequivocal.eu> - 2020-03-16 20:06 +0000
Re: Object values (continued) John G Harris <niam@jghnorth.org.uk.invalid> - 2020-03-17 19:01 +0000
Re: Object values (continued) Jon Ribbens <jon+usenet@unequivocal.eu> - 2020-03-17 19:55 +0000
Re: Object values (continued) John G Harris <niam@jghnorth.org.uk.invalid> - 2020-03-18 17:29 +0000
Re: Object values (continued) JJ <jj4public@vfemail.net> - 2020-03-17 12:48 +0700
Re: Object values (continued) Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2020-03-17 17:51 +0100
Re: Object values (continued) John G Harris <niam@jghnorth.org.uk.invalid> - 2020-03-17 19:03 +0000
Re: Object values (continued) Andrew Poulos <ap_prog@hotmail.com> - 2020-03-18 07:20 +1100
Re: Object values (continued) John G Harris <niam@jghnorth.org.uk.invalid> - 2020-03-18 17:29 +0000
Re: Object values (continued) Andrew Poulos <ap_prog@hotmail.com> - 2020-03-19 14:21 +1100
Re: Object values (continued) John G Harris <niam@jghnorth.org.uk.invalid> - 2020-03-19 11:12 +0000
Re: Object values (continued) Andrew Poulos <ap_prog@hotmail.com> - 2020-03-20 14:33 +1100
Re: Object values (continued) John G Harris <niam@jghnorth.org.uk.invalid> - 2020-03-20 09:21 +0000
Re: Object values (continued) Andrew Poulos <ap_prog@hotmail.com> - 2020-03-21 09:56 +1100
Re: Object values (continued) John G Harris <niam@jghnorth.org.uk.invalid> - 2020-03-21 11:18 +0000
Re: Object values (continued) Andrew Poulos <ap_prog@hotmail.com> - 2020-03-22 08:45 +1100
Re: Object values (continued) John G Harris <niam@jghnorth.org.uk.invalid> - 2020-03-22 10:10 +0000
Re: Object values (continued) Andrew Poulos <ap_prog@hotmail.com> - 2020-03-23 07:44 +1100
Re: Object values (continued) John G Harris <niam@jghnorth.org.uk.invalid> - 2020-03-17 19:09 +0000
Re: Object values (continued) Richard Damon <Richard@Damon-Family.org> - 2020-03-17 16:21 -0400
Re: Object values (continued) Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2020-03-17 22:57 +0100
Re: Object values (continued) Julio Di Egidio <julio@diegidio.name> - 2020-03-19 05:32 -0700
Re: Object values (continued) Silvio <silvio@internet.com> - 2020-03-19 15:26 +0100
Re: Object values (continued) John G Harris <niam@jghnorth.org.uk.invalid> - 2020-03-19 18:16 +0000
Re: Object values (continued) John G Harris <niam@jghnorth.org.uk.invalid> - 2020-03-19 18:15 +0000
Re: Object values (continued) Julio Di Egidio <julio@diegidio.name> - 2020-03-19 11:54 -0700
Re: Object values (continued) John G Harris <niam@jghnorth.org.uk.invalid> - 2020-03-20 09:11 +0000
Re: Object values (continued) John G Harris <niam@jghnorth.org.uk.invalid> - 2020-03-27 15:35 +0000
Re: Object values (continued) Julio Di Egidio <julio@diegidio.name> - 2020-03-27 09:59 -0700
Re: Object values (continued) John G Harris <niam@jghnorth.org.uk.invalid> - 2020-03-28 14:09 +0000
Re: Object values (continued) Andrew Poulos <ap_prog@hotmail.com> - 2020-03-29 14:18 +1100
Re: Object values (continued) John G Harris <niam@jghnorth.org.uk.invalid> - 2020-03-29 10:40 +0100
Re: Object values (continued) Julio Di Egidio <julio@diegidio.name> - 2020-03-29 04:41 -0700
Re: Object values (continued) John G Harris <niam@jghnorth.org.uk.invalid> - 2020-03-21 14:12 +0000
Re: Object values (continued) "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2020-03-21 19:45 +0100
Re: Object values (continued) John G Harris <niam@jghnorth.org.uk.invalid> - 2020-03-22 10:30 +0000
Re: Object values (continued) "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2020-03-22 23:30 +0100
Re: Object values (continued) John G Harris <niam@jghnorth.org.uk.invalid> - 2020-03-23 09:44 +0000
Re: Object values (continued) "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2020-03-23 11:19 +0100
Re: Object values (continued) Julio Di Egidio <julio@diegidio.name> - 2020-03-23 05:00 -0700
Re: Object values (continued) John G Harris <niam@jghnorth.org.uk.invalid> - 2020-03-23 18:05 +0000
Re: Object values (continued) Julio Di Egidio <julio@diegidio.name> - 2020-03-23 11:50 -0700
Re: Object values (continued) John G Harris <niam@jghnorth.org.uk.invalid> - 2020-03-23 19:34 +0000
Re: Object values (continued) John G Harris <niam@jghnorth.org.uk.invalid> - 2020-03-23 18:14 +0000
Re: Object values (continued) "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2020-03-23 22:21 +0100
Re: Object values (continued) John G Harris <niam@jghnorth.org.uk.invalid> - 2020-03-24 14:09 +0000
Re: Object values (continued) "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2020-03-25 00:01 +0100
Re: Object values (continued) Silvio <silvio@internet.com> - 2020-03-24 01:18 +0100
Re: Object values (continued) John G Harris <niam@jghnorth.org.uk.invalid> - 2020-03-24 14:24 +0000
Re: Object values (continued) Silvio <silvio@internet.com> - 2020-03-24 15:43 +0100
Re: Object values (continued) Julio Di Egidio <julio@diegidio.name> - 2020-03-24 11:03 -0700
Re: Object values (continued) John G Harris <niam@jghnorth.org.uk.invalid> - 2020-03-24 18:23 +0000
Re: Object values (continued) Silvio <silvio@internet.com> - 2020-03-24 22:19 +0100
Re: Object values (continued) John G Harris <niam@jghnorth.org.uk.invalid> - 2020-03-25 16:34 +0000
Re: Object values (continued) "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2020-03-25 23:17 +0100
Re: Object values (continued) Silvio <silvio@internet.com> - 2020-03-26 01:27 +0100
Re: Object values (continued) Andrew Poulos <ap_prog@hotmail.com> - 2020-03-26 18:58 +1100
Re: Object values (continued) Ben Bacarisse <ben.usenet@bsb.me.uk> - 2020-03-26 10:43 +0000
Re: Object values (continued) Silvio <silvio@internet.com> - 2020-03-26 12:22 +0100
Re: Object values (continued) "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2020-03-26 10:08 -0700
Re: Object values (continued) Silvio <silvio@internet.com> - 2020-03-26 18:29 +0100
Re: Object values (continued) "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2020-03-26 14:17 -0700
Re: Object values (continued) Silvio <silvio@internet.com> - 2020-03-26 23:37 +0100
Re: Object values (continued) "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2020-03-26 16:40 -0700
Re: Object values (continued) Silvio <silvio@internet.com> - 2020-03-27 11:38 +0100
Re: Object values (continued) John G Harris <niam@jghnorth.org.uk.invalid> - 2020-03-26 18:11 +0000
Re: Object values (continued) Silvio <silvio@internet.com> - 2020-03-26 19:41 +0100
Re: Object values (continued) "Mark-" <nospam@mapson.xyz> - 2020-03-25 00:00 +0000
Re: Object values (continued) John G Harris <niam@jghnorth.org.uk.invalid> - 2020-03-25 15:05 +0000
Re: Object values (continued) "Mark-" <nospam@mapson.xyz> - 2020-03-25 20:12 +0000
Re: Object values (continued) John G Harris <niam@jghnorth.org.uk.invalid> - 2020-03-26 18:09 +0000
Re: Object values (continued) John G Harris <niam@jghnorth.org.uk.invalid> - 2020-03-25 19:39 +0000
Re: Object values (continued) "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2020-03-23 18:49 -0700
Page 2 of 4 — ← Prev page 1 [2] 3 4 Next page →
| From | Andrew Poulos <ap_prog@hotmail.com> |
|---|---|
| Date | 2020-03-23 07:44 +1100 |
| Subject | Re: Object values (continued) |
| Message-ID | <L4udnVWIbeShU-rDnZ2dnUU7-QPNnZ2d@westnet.com.au> |
| In reply to | #38296 |
On 22/03/2020 9:10 pm, John G Harris wrote: > On Sun, 22 Mar 2020 08:45:20 +1100, Andrew Poulos > <ap_prog@hotmail.com> wrote: > > <snip> >> No need to question my contribution. Question your own attempts at >> polishing a turd. > > In other words, you are upset because I used Thomas's words to > criticise Thomas, who can do no wrong. There you go polishing away. Jumping to conclusions about other people's emotional state because your posts contain factual errors. Andrew Poulos
[toc] | [prev] | [next] | [standalone]
| From | John G Harris <niam@jghnorth.org.uk.invalid> |
|---|---|
| Date | 2020-03-17 19:09 +0000 |
| Message-ID | <f0827fd6opgb22lbnbd0rghvhcaqdg0i3k@4ax.com> |
| In reply to | #38251 |
On Tue, 17 Mar 2020 12:48:17 +0700, JJ <jj4public@vfemail.net> wrote: >On Mon, 16 Mar 2020 14:34:50 +0000, John G Harris wrote: >> >> I really cannot understand why some people are fixated on references. > >In JavaScript, everything are objects. There's a problem when *everything* is an object. You look at an object and see it holds a value, which is an object that holds a value, which is an object that holds a value, which is an object that holds a value, ... ... After descending through an infinite sequence of objects you still haven't reached "Hello World!". John
[toc] | [prev] | [next] | [standalone]
| From | Richard Damon <Richard@Damon-Family.org> |
|---|---|
| Date | 2020-03-17 16:21 -0400 |
| Subject | Re: Object values (continued) |
| Message-ID | <WiacG.120366$UC6.67584@fx09.iad> |
| In reply to | #38255 |
On 3/17/20 3:09 PM, John G Harris wrote: > On Tue, 17 Mar 2020 12:48:17 +0700, JJ <jj4public@vfemail.net> wrote: > >> On Mon, 16 Mar 2020 14:34:50 +0000, John G Harris wrote: >>> >>> I really cannot understand why some people are fixated on references. >> >> In JavaScript, everything are objects. > > There's a problem when *everything* is an object. You look at an > object and see it holds a value, which is an object that holds a > value, which is an object that holds a value, which is an object that > holds a value, ... ... > > After descending through an infinite sequence of objects you still > haven't reached "Hello World!". > > John > Expect that when you get to the string object that holds the value of "Hello World!", that object IS the value you want to get to, so you stop.
[toc] | [prev] | [next] | [standalone]
| From | Thomas 'PointedEars' Lahn <PointedEars@web.de> |
|---|---|
| Date | 2020-03-17 22:57 +0100 |
| Subject | Re: Object values (continued) |
| Message-ID | <2017896.irdbgypaU6@PointedEars.de> |
| In reply to | #38258 |
Richard Damon wrote:
> On 3/17/20 3:09 PM, John G Harris wrote:
>> On Tue, 17 Mar 2020 12:48:17 +0700, JJ <jj4public@vfemail.net> wrote:
>>> On Mon, 16 Mar 2020 14:34:50 +0000, John G Harris wrote:
>>>> I really cannot understand why some people are fixated on references.
>>> In JavaScript, everything are objects.
>> There's a problem when *everything* is an object. You look at an
>> object and see it holds a value, which is an object that holds a
>> value, which is an object that holds a value, which is an object that
>> holds a value, ... ...
>>
>> After descending through an infinite sequence of objects you still
>> haven't reached "Hello World!".
>
> Expect that when you get to the string object that holds the value of
> "Hello World!", that object IS the value you want to get to, so you stop.
Actually, there are *primitive* String values, which are NOT objects; and
there are String *instances*, which *are* objects/object values. In both
cases, accessing the value in comparison or concatenation or property access
is the same as operating on the primitive String value.
Notably, the “typeof” operation is NOT one of those operations that do not
distinguish between primitive String value and String instance:
/* "string" */
typeof '42'
/* "object" */
typeof new String('42')
In general, it is a good idea to avoid creating String instances (and
instances of other primitive types) explicitly, which is why the rule
“no-new-wrappers“ is documented as a “Best Practice” rule in ESLint,
and recommended as “to be enabled” by the Airbnb JavaScript Style Guide,
currently per rule 22.2:
<https://eslint.org/docs/rules/>
<https://github.com/airbnb/javascript#type-casting--coercion>
Also, it is possible to "subclass" (for lack of a better word) the String
type such that the "subclass" provides additional behavior and methods that
operate on the primitive String value; for example:
function MyString (s)
{
/* As a rule of thumb, always call the constructor of the parent */
String.call(this, s);
}
MyString.prototype = Object.create(String.prototype, {
length: {
get: function () { return this.getLength(); }
},
getLength: {
value: function () { return 42; }
}
});
[Notably,
class MyString extends String {
// …
}
only works partially: the “length” getter *cannot* be overwritten with a
class declaration or Object.defineProperty(); the latter even throws an
exception (in Google V8 JavaScript 7.3.492.22 in “Chromium 73.0.3683.75
(Developer Build) built on Debian 9.8, running on Debian 9 (64-bit)”).]
[One such example of "subclassing" String is
jsx.string.unicode.WideString which can be used as drop-in replacement
for String in order to handle properly String values containing
characters beyond the Basic Multilingual Plane (BMP)¹:
<https://github.com/PointedEars/JSX/blob/master/string/unicode.js>]
It is therefore a good idea to use
s instanceof String
or (if that is not available or not feasible)
typeof s.toString() == 'string'
instead of just
typeof s == 'string'
to find out whether a value can be used as if it were a primitive String
value, should that be required (often one can rely on implicit type
conversion).
______
¹ Notably, while ECMAScript Edition 7 introduced some support for those
characters with the String.prototype.codePointAt() method, as of Edition
10 the “length” property will and implementations of it do *still* return
the value 2 for a String value containing only *one* character beyond
the BMP. JSX:string/unicode.js fixes this with
[new] jsx.string.unicode.WideString(…).length which calls
jsx.string.unicode.WideString.prototype.getLength().
--
PointedEars
FAQ: <http://PointedEars.de/faq> | <http://PointedEars.de/es-matrix>
<https://github.com/PointedEars> | <http://PointedEars.de/wsvn/>
Twitter: @PointedEars2 | Please do not cc me./Bitte keine Kopien per E-Mail.
[toc] | [prev] | [next] | [standalone]
| From | Julio Di Egidio <julio@diegidio.name> |
|---|---|
| Date | 2020-03-19 05:32 -0700 |
| Message-ID | <2ebd204c-9149-455d-ac9c-1e6f1cd0db5e@googlegroups.com> |
| In reply to | #38247 |
On Monday, 16 March 2020 15:34:55 UTC+1, John G Harris wrote: > Thomas Lahn wrote, of an array : > > Technically it is not actually containing the objects, but just the > > references to them." > > I really cannot understand why some people are fixated on references. > There is a way to implement values that puts an object right inside > the value field <snipped nonsense> No, there isn't, indeed the one who is talking nonsense on the whole line, essentially not knowing the exact meaning of these words and how they are used in different contexts, is just you. The *value of* a variable or property can be either simple data (as in primitive data) or complex data (as in objects or arrays). The value of a variable or property can be either directly the data or it can be a reference to that data (again, where that can be either simple or complex data): the former is called *by value*, the latter is called *by reference* (same distinction applies to function arguments). That said, the difference between by value and by reference is immediately and primarily one of semantics, not one of implementation: var x=1, y=x; x++; console.log(y); // --> "1" var x=[1], y=x; x.push(2); console.log(y); // --> "[1, 2]" And still of semantics are issues such as how the notion of equality differs, or *assignment*: with reference types only the reference is copied over, with value types the data is copied. Implementation details such as stack vs heap allocation, or pointers to data vs pointers to other pointers, really add (almost) nothing, especially in JS where there is no control and not even any visibility on these mechanisms. HTH, Julio
[toc] | [prev] | [next] | [standalone]
| From | Silvio <silvio@internet.com> |
|---|---|
| Date | 2020-03-19 15:26 +0100 |
| Subject | Re: Object values (continued) |
| Message-ID | <5e738129$0$3984$e4fe514c@newszilla.xs4all.nl> |
| In reply to | #38264 |
On 3/19/20 1:32 PM, Julio Di Egidio wrote: > On Monday, 16 March 2020 15:34:55 UTC+1, John G Harris wrote: >> Thomas Lahn wrote, of an array : >>> Technically it is not actually containing the objects, but just the >>> references to them." >> >> I really cannot understand why some people are fixated on references. >> There is a way to implement values that puts an object right inside >> the value field > <snipped nonsense> > > No, there isn't, indeed the one who is talking nonsense on the whole line, > essentially not knowing the exact meaning of these words and how they are > used in different contexts, is just you. > > The *value of* a variable or property can be either simple data (as in > primitive data) or complex data (as in objects or arrays). > > The value of a variable or property can be either directly the data > or it can be a reference to that data (again, where that can be either > simple or complex data): the former is called *by value*, the latter is > called *by reference* (same distinction applies to function arguments). > > That said, the difference between by value and by reference is immediately > and primarily one of semantics, not one of implementation: > var x=1, y=x; x++; console.log(y); // --> "1" > var x=[1], y=x; x.push(2); console.log(y); // --> "[1, 2]" > > And still of semantics are issues such as how the notion of equality differs, > or *assignment*: with reference types only the reference is copied over, with > value types the data is copied. > > Implementation details such as stack vs heap allocation, or pointers to data > vs pointers to other pointers, really add (almost) nothing, especially in JS > where there is no control and not even any visibility on these mechanisms. > > HTH, > > Julio > Finally someone who makes sense in this thread.
[toc] | [prev] | [next] | [standalone]
| From | John G Harris <niam@jghnorth.org.uk.invalid> |
|---|---|
| Date | 2020-03-19 18:16 +0000 |
| Subject | Re: Object values (continued) |
| Message-ID | <emd77fhr2mskjucajqs0vjfjmoppv2c38a@4ax.com> |
| In reply to | #38265 |
On Thu, 19 Mar 2020 15:26:49 +0100, Silvio <silvio@internet.com> wrote: >On 3/19/20 1:32 PM, Julio Di Egidio wrote: <snip> >> Julio >> > >Finally someone who makes sense in this thread. Yes, if you want to learn about Java or C. John
[toc] | [prev] | [next] | [standalone]
| From | John G Harris <niam@jghnorth.org.uk.invalid> |
|---|---|
| Date | 2020-03-19 18:15 +0000 |
| Message-ID | <shd77fde37gt9tj2e6urkqjsd4b870hupj@4ax.com> |
| In reply to | #38264 |
On Thu, 19 Mar 2020 05:32:09 -0700 (PDT), Julio Di Egidio <julio@diegidio.name> wrote: >On Monday, 16 March 2020 15:34:55 UTC+1, John G Harris wrote: >> Thomas Lahn wrote, of an array : >> > Technically it is not actually containing the objects, but just the >> > references to them." >> >> I really cannot understand why some people are fixated on references. >> There is a way to implement values that puts an object right inside >> the value field ><snipped nonsense> > >No, there isn't, indeed the one who is talking nonsense on the whole line, >essentially not knowing the exact meaning of these words and how they are >used in different contexts, is just you. > >The *value of* a variable or property can be either simple data (as in >primitive data) or complex data (as in objects or arrays). > >The value of a variable or property can be either directly the data >or it can be a reference to that data At this point I have to stop reading what you've written. What the *STANDARD* for ECMAScript, the core language of each JavaScript, is this: "An ECMAScript language type corresponds to values that are directly manipulated by an ECMAScript programmer using the ECMAScript language. The ECMAScript language types are Undefined, Null, Boolean, String, Symbol, Number, and Object. An ECMAScript language value is a value that is characterized by an ECMAScript language type." I'll repeat part of that : "and Object". Now please start talking about ECMAScript and stop talking about some other language you've used. John
[toc] | [prev] | [next] | [standalone]
| From | Julio Di Egidio <julio@diegidio.name> |
|---|---|
| Date | 2020-03-19 11:54 -0700 |
| Message-ID | <80feab19-ddb4-4fe5-a16e-ea56f949c083@googlegroups.com> |
| In reply to | #38266 |
On Thursday, 19 March 2020 19:15:11 UTC+1, John G Harris wrote: > On Thu, 19 Mar 2020 05:32:09 -0700 (PDT), Julio Di Egidio > <julio@diegidio.name> wrote: > >On Monday, 16 March 2020 15:34:55 UTC+1, John G Harris wrote: > >> Thomas Lahn wrote, of an array : > >> > Technically it is not actually containing the objects, but just the > >> > references to them." > >> > >> I really cannot understand why some people are fixated on references. > >> There is a way to implement values that puts an object right inside > >> the value field > ><snipped nonsense> > > > >No, there isn't, indeed the one who is talking nonsense on the whole line, > >essentially not knowing the exact meaning of these words and how they are > >used in different contexts, is just you. > > > >The *value of* a variable or property can be either simple data (as in > >primitive data) or complex data (as in objects or arrays). > > > >The value of a variable or property can be either directly the data > >or it can be a reference to that data > > At this point I have to stop reading what you've written. What the > *STANDARD* for ECMAScript, the core language of each JavaScript, is > this: > > "An ECMAScript language type corresponds to values that are directly > manipulated by an ECMAScript programmer using the ECMAScript language. > The ECMAScript language types are Undefined, Null, Boolean, String, > Symbol, Number, and Object. An ECMAScript language value is a value > that is characterized by an ECMAScript language type." > > I'll repeat part of that : "and Object". That is the part that Thomas has explained and it does not contradict anything that I have said: nor vice versa. > Now please start talking about ECMAScript and stop talking about some > other language you've used. Why do you keep talking crap? I can understand a Dunning-Kruger effect, but not after being repeatedly warned. *Troll alert* Julio
[toc] | [prev] | [next] | [standalone]
| From | John G Harris <niam@jghnorth.org.uk.invalid> |
|---|---|
| Date | 2020-03-20 09:11 +0000 |
| Message-ID | <12297fd697sp32svasocs71vdk7e5he9ho@4ax.com> |
| In reply to | #38268 |
On Thu, 19 Mar 2020 11:54:49 -0700 (PDT), Julio Di Egidio <julio@diegidio.name> wrote: <snip> >That is the part that Thomas has explained and it does not contradict >anything that I have said: nor vice versa. <snip> Julio, do you agree that the compiler makes sure that any dereferencing of references will be silent, invisible, and cannot be detected by the ECMAScript program? Of course you agree, otherwise you would have written a program that detects where dereferencing occurs and where it doesn't. So, why do you hate people who think that mentioning silent, invisible, undetectable, dereferencing is a waste of breath? And why do you hurl insults at anyone who says what their program does but doesn't bother mentioning all the silent, invisible, undetectable, dereferencing? After all, it's what ECMA 262 does when specifying the semantics of the language. John
[toc] | [prev] | [next] | [standalone]
| From | John G Harris <niam@jghnorth.org.uk.invalid> |
|---|---|
| Date | 2020-03-27 15:35 +0000 |
| Message-ID | <o97s7fl1rdrue496kb1jq9tecolh3tnp6i@4ax.com> |
| In reply to | #38279 |
On Fri, 20 Mar 2020 09:11:52 +0000, John G Harris <niam@jghnorth.org.uk.invalid> wrote: >On Thu, 19 Mar 2020 11:54:49 -0700 (PDT), Julio Di Egidio ><julio@diegidio.name> wrote: > > <snip> >>That is the part that Thomas has explained and it does not contradict >>anything that I have said: nor vice versa. > <snip> > >Julio, do you agree that the compiler makes sure that any >dereferencing of references will be silent, invisible, and cannot be >detected by the ECMAScript program? > >Of course you agree, otherwise you would have written a program that >detects where dereferencing occurs and where it doesn't. > >So, why do you hate people who think that mentioning silent, >invisible, undetectable, dereferencing is a waste of breath? > >And why do you hurl insults at anyone who says what their program does >but doesn't bother mentioning all the silent, invisible, undetectable, >dereferencing? After all, it's what ECMA 262 does when specifying the >semantics of the language. Julio hasn't answered. This is understandable. If he agrees with me it would be shaming for him. If he disagrees with me then his colleagues would laugh at him. Unfortunately, they are the key questions in this (far too long) discussion thread. John -- OCCAM RULES, OK!
[toc] | [prev] | [next] | [standalone]
| From | Julio Di Egidio <julio@diegidio.name> |
|---|---|
| Date | 2020-03-27 09:59 -0700 |
| Message-ID | <fb7da44b-cdf7-4ec7-9a33-aa55bebd8457@googlegroups.com> |
| In reply to | #38340 |
On Friday, 27 March 2020 16:35:51 UTC+1, John G Harris wrote: > >Julio, do you agree that the compiler makes sure that any > >dereferencing of references will be silent, invisible, and cannot be > >detected by the ECMAScript program? That is meaningless bullshit, as everything you have posted so far. > Unfortunately, they are the key questions in this (far too long) > discussion thread. No worries, not long enough that it is not apparent that you are simply a troll and full of shit. *Plonk* Julio
[toc] | [prev] | [next] | [standalone]
| From | John G Harris <niam@jghnorth.org.uk.invalid> |
|---|---|
| Date | 2020-03-28 14:09 +0000 |
| Message-ID | <0jmu7f578mu0p89vu35bhapc3gtd7jeci0@4ax.com> |
| In reply to | #38341 |
On Fri, 27 Mar 2020 09:59:01 -0700 (PDT), Julio Di Egidio <julio@diegidio.name> wrote: <snip> >That is meaningless bullshit, as everything you have posted so far. <snip> >No worries, not long enough that it is not apparent that you are >simply a troll and full of shit. The rubber stamp reply, requiring no effort and no thought. Here's the plan : 1 Furiously argue about whether, when saying what your program does, you also say where the compiler makes your program follow a pointer. 1A Take a vote on it. 2 Furiously argue about where the compiler makes your program follow a pointer : is it over here, or over there, or might be either. 2A Take a vote on it. 3 Furiously argue about whether to say where the compiler makes your program follow a pointer in all cases or only in some cases, and if so which cases. 3A Take a vote on it. 4 Order UseNet to censor any article that discusses, or even mentions, anything voted down. End of. John -- OCCAM RULES, OK!
[toc] | [prev] | [next] | [standalone]
| From | Andrew Poulos <ap_prog@hotmail.com> |
|---|---|
| Date | 2020-03-29 14:18 +1100 |
| Subject | Re: Object values (continued) |
| Message-ID | <wpWdnc6l8ebsjh3DnZ2dnUU7-WvNnZ2d@westnet.com.au> |
| In reply to | #38342 |
On 29/03/2020 1:09 am, John G Harris wrote: > On Fri, 27 Mar 2020 09:59:01 -0700 (PDT), Julio Di Egidio > <julio@diegidio.name> wrote: > > <snip> >> That is meaningless bullshit, as everything you have posted so far. > <snip> >> No worries, not long enough that it is not apparent that you are >> simply a troll and full of shit. > > The rubber stamp reply, requiring no effort and no thought. Oh ok, here it is: you are very busy, earnestly polishing a turd. Andrew Poulos
[toc] | [prev] | [next] | [standalone]
| From | John G Harris <niam@jghnorth.org.uk.invalid> |
|---|---|
| Date | 2020-03-29 10:40 +0100 |
| Subject | Re: Object values (continued) |
| Message-ID | <b6r08f55ophrg718escb6u95praepib1j4@4ax.com> |
| In reply to | #38343 |
On Sun, 29 Mar 2020 14:18:06 +1100, Andrew Poulos <ap_prog@hotmail.com> wrote: <snip> >Oh ok, here it is: you are very busy, earnestly polishing a turd. So what is your vote ? Or is voting technical and therefore beneath your diginity ? John
[toc] | [prev] | [next] | [standalone]
| From | Julio Di Egidio <julio@diegidio.name> |
|---|---|
| Date | 2020-03-29 04:41 -0700 |
| Subject | Re: Object values (continued) |
| Message-ID | <428400cf-3c54-4374-9a72-fa05e41c02d0@googlegroups.com> |
| In reply to | #38343 |
On Sunday, 29 March 2020 05:18:18 UTC+2, Andrew Poulos wrote: > On 29/03/2020 1:09 am, John G Harris wrote: > > On Fri, 27 Mar 2020 09:59:01 -0700 (PDT), Julio Di Egidio > > <julio@diegidio.name> wrote: > > > > <snip> > >> That is meaningless bullshit, as everything you have posted so far. > > <snip> > >> No worries, not long enough that it is not apparent that you are > >> simply a troll and full of shit. > > > > The rubber stamp reply, requiring no effort and no thought. > > Oh ok, here it is: you are very busy, earnestly polishing a turd. Stupid is who stupid does. You too please stop this crap. Julio
[toc] | [prev] | [next] | [standalone]
| From | John G Harris <niam@jghnorth.org.uk.invalid> |
|---|---|
| Date | 2020-03-21 14:12 +0000 |
| Message-ID | <e58c7f1voimm7k775uctl2q8tostvrb5tt@4ax.com> |
| In reply to | #38264 |
On Thu, 19 Mar 2020 05:32:09 -0700 (PDT), Julio Di Egidio <julio@diegidio.name> wrote: <snip> >The *value of* a variable or property can be either simple data (as in >primitive data) or complex data (as in objects or arrays). > >The value of a variable or property can be either directly the data >or it can be a reference to that data (again, where that can be either >simple or complex data): the former is called *by value*, the latter is >called *by reference* I haven't come across this use of 'by value' and 'by reference' before, nor can I find it in Wikipedia[English language]. You should add it. >(same distinction applies to function arguments). But note that call by reference is not available in ECMAScript. There is no syntax to ask for it, nor in true FP languages. (Using the Wikipedia definition of 'call by reference'). >That said, the difference between by value and by reference is immediately >and primarily one of semantics, not one of implementation: > var x=1, y=x; x++; console.log(y); // --> "1" > var x=[1], y=x; x.push(2); console.log(y); // --> "[1, 2]" > >And still of semantics are issues such as how the notion of equality differs, >or *assignment*: with reference types only the reference is copied over, with >value types the data is copied. Assignment, for objects : In C++ the object is copied. In Java the object is not copied, because it is never a value. >Implementation details such as stack vs heap allocation, or pointers to data >vs pointers to other pointers, really add (almost) nothing, especially in JS >where there is no control and not even any visibility on these mechanisms. I'm glad we agree on something, especially about non-visibility. John
[toc] | [prev] | [next] | [standalone]
| From | "Evertjan." <exxjxw.hannivoort@inter.nl.net> |
|---|---|
| Date | 2020-03-21 19:45 +0100 |
| Message-ID | <XnsAB87C8E8B32E5eejj99@194.109.6.166> |
| In reply to | #38293 |
John G Harris <niam@jghnorth.org.uk.invalid> wrote on 21 Mar 2020 in
comp.lang.javascript:
> I haven't come across this use of 'by value' and 'by reference'
> before, nor can I find it in Wikipedia[English language]. You should
> add it.
A primitive variable is referenced by value,
while an object is referenced by reference:
<script>
let a = 0;
const b = {};
b.a = 7;
const f = (c, d) => {
c = c + 100;
d.a = d.a + 100;
};
alert('a: ' + a); // 0
alert('b.a: ' + b.a); // 7
f(a, b);
alert('a: ' + a); // 0
alert('b.a: ' + b.a); // 107
</script>
--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
[toc] | [prev] | [next] | [standalone]
| From | John G Harris <niam@jghnorth.org.uk.invalid> |
|---|---|
| Date | 2020-03-22 10:30 +0000 |
| Message-ID | <kcfe7f5r3t7dec74nn01b9up0s0npa0fr0@4ax.com> |
| In reply to | #38294 |
On Sat, 21 Mar 2020 19:45:00 +0100, "Evertjan."
<exxjxw.hannivoort@inter.nl.net> wrote:
>John G Harris <niam@jghnorth.org.uk.invalid> wrote on 21 Mar 2020 in
>comp.lang.javascript:
>
>> I haven't come across this use of 'by value' and 'by reference'
>> before, nor can I find it in Wikipedia[English language]. You should
>> add it.
>
>A primitive variable is referenced by value,
>while an object is referenced by reference:
An interesting theory so why isn't it in Wikipedia, preferably with
citations ?
Now explain why a variable is big enough to hold a 1 Mbyte primitive
string but not big enough to hold a 400 byte object.
><script>
>
>let a = 0;
>const b = {};
>b.a = 7;
You're saying that .a can't be actioned if you assume that b's value
is an object, not a pointer. How does the code below prove that?
It proves that if b's value is a pointer then automatic dereferencing
will get the right result. It doesn't prove that no other way is
possible.
>const f = (c, d) => {
> c = c + 100;
> d.a = d.a + 100;
>};
>
>alert('a: ' + a); // 0
>alert('b.a: ' + b.a); // 7
>
>f(a, b);
>
>alert('a: ' + a); // 0
>alert('b.a: ' + b.a); // 107
>
></script>
[toc] | [prev] | [next] | [standalone]
| From | "Evertjan." <exxjxw.hannivoort@inter.nl.net> |
|---|---|
| Date | 2020-03-22 23:30 +0100 |
| Message-ID | <XnsAB88EF22EF888eejj99@194.109.6.166> |
| In reply to | #38297 |
John G Harris <niam@jghnorth.org.uk.invalid> wrote on 22 Mar 2020 in
comp.lang.javascript:
> On Sat, 21 Mar 2020 19:45:00 +0100, "Evertjan."
> <exxjxw.hannivoort@inter.nl.net> wrote:
>
>>John G Harris <niam@jghnorth.org.uk.invalid> wrote on 21 Mar 2020 in
>>comp.lang.javascript:
>>
>>> I haven't come across this use of 'by value' and 'by reference'
>>> before, nor can I find it in Wikipedia[English language]. You should
>>> add it.
>>
>>A primitive variable is referenced by value,
>>while an object is referenced by reference:
>
> An interesting theory
It is not a theory, it is a fact proven by the below code.
> so why isn't it in Wikipedia, preferably with citations ?
What a nonsensical argument, why is your great-grandmother not in Wikipedia?
> Now explain why a variable is big enough to hold a 1 Mbyte primitive
> string but not big enough to hold a 400 byte object.
Again, that has nothing to do with it.
>><script>
>>
>>let a = 0;
>>const b = {};
>>b.a = 7;
>
> You're saying that .a can't be actioned if you assume that b's value
> is an object, not a pointer. How does the code below prove that?
No, I'm not saying that.
ALL let and const declared names are pointers, but pointers to primitive
variables are handled different from pointers to objets.
*** Pointers to primitive variables are handled by VALUE.
*** Pointers to objects are handled by REFERENCE.
[However, in practice you can forget about the pointers,
as their pointing values are internal and hidden to the programmer]
> It proves that if b's value is a pointer then automatic dereferencing
> will get the right result. It doesn't prove that no other way is
> possible.
I am not talking about "dereferencing", whatever that is.
>
>>const f = (c, d) => {
>> c = c + 100;
>> d.a = d.a + 100;
>>};
>>
>>alert('a: ' + a); // 0
>>alert('b.a: ' + b.a); // 7
>>
>>f(a, b);
>>
>>alert('a: ' + a); // 0
>>alert('b.a: ' + b.a); // 107
>>
>></script>
>
--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
[toc] | [prev] | [next] | [standalone]
Page 2 of 4 — ← Prev page 1 [2] 3 4 Next page →
Back to top | Article view | comp.lang.javascript
csiph-web