Are objects values?
naveen.chwl at gmail.com
Sat Aug 19 18:44:08 UTC 2017
But references are also values. It's not a mutually exclusive thing
On Sat, 19 Aug 2017, 11:32 p.m. kdex <kdex at kdex.de> wrote:
> Yes, objects/functions are values, but they are not *primitive* values.
> The current draft uses the phrasing "object value" several times.
> Section 4.3.3 explains that objects are "members of type Object", and a
> is, by definition, a set of values. Therefore, objects must be values.
> On Saturday, August 19, 2017 7:34:45 PM CEST T.J. Crowder wrote:
> > I recently had an exchange which started out with my "correcting" someone
> > who said "Functions are values" by saying "Function *references* are
> > values. Functions are objects." He/she replied that objects are also
> > spec]:
> > > An ECMAScript *language type* corresponds to values that are directly
> > manipulated by an ECMAScript programmer using the ECMAScript language.
> > 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.
> > ...and said "So objects are values."
> > Is he/she right? [Wikpedia] isn't much help, at least not to me. I
> > a friend who, unlike me, did get comp sci theory at Uni, and he said
> > "...you're not wrong, but it's very Humpty Dumpty: When I use a word, it
> > means just what I choose it to mean -- neither more nor less."
> > I've used the term "value" in explanations of variables, properties, and
> > function arguments and in particular when explaining why `b = a` copies
> > object reference, not an object, from `a` to `b`. (Saying the *object
> > reference* is the value.) It's been an invaluable aid to helping people
> > "get" object references.
> > I'd be very sorry to hear that I was misusing a term of art. But I'd
> > know. :-)
> > If I'm misusing "value," what should I use instead for that thing that
> > actually gets stored in memory? How to explain the `b = a` thing with
> > object references to beginners?
> > This is slightly off-topic for the thread, but also not, as I spend a lot
> > text being used to tell me I'm wrong are on this list. :-)
> > Thanks,
> > -- T.J. Crowder
> > :
> > guage-types : https://en.wikipedia.org/wiki/Value_(computer_science)
> es-discuss mailing list
> es-discuss at mozilla.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the es-discuss