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


Groups > comp.lang.javascript > #27877

Re: Identity of values in Javascript

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!1.eu.feeder.erje.net!eternal-september.org!feeder.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail
From Ben Bacarisse <ben.usenet@bsb.me.uk>
Newsgroups comp.lang.javascript
Subject Re: Identity of values in Javascript
Date Tue, 26 May 2015 00:10:54 +0100
Organization A noiseless patient Spider
Lines 52
Message-ID <87pp5ofe2p.fsf@bsb.me.uk> (permalink)
References <555f256b$0$12988$c3e8da3$5496439d@news.astraweb.com> <87r3q8h3yf.fsf@bsb.me.uk> <555f7d3b$0$13002$c3e8da3$5496439d@news.astraweb.com> <87d21sgpqy.fsf@bsb.me.uk> <5561f871$0$13006$c3e8da3$5496439d@news.astraweb.com> <874mn1ehbk.fsf@bsb.me.uk> <55630be0$0$13000$c3e8da3$5496439d@news.astraweb.com>
Mime-Version 1.0
Content-Type text/plain; charset=iso-8859-1
Content-Transfer-Encoding 8bit
Injection-Info mx02.eternal-september.org; posting-host="017616aa25f81ec581c44d76d61ba2f3"; logging-data="28341"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+F+83HpMIUZ1KBgine7LoHyTAlaR2mxbU="
Cancel-Lock sha1:yMbj2aiOlVI5jfM1JpR+9KA3COo= sha1:r+/Ht43uO5JES47IpwNVF8d2D88=
X-BSB-Auth 1.e0007c8b073a54038f8c.20150526001054BST.87pp5ofe2p.fsf@bsb.me.uk
Xref csiph.com comp.lang.javascript:27877

Show key headers only | View raw


Steven D'Aprano <steve@pearwood.info> writes:

> On Mon, 25 May 2015 08:33 am, Ben Bacarisse wrote:
>
>> The
>> language specification is the way to tell what the semantics of argument
>> passing are.  That's a lot simpler than looking at an implementation.
>
> Assuming that there is a language specification, that it states what the
> semantics are in unambiguous detail (specs can be buggy too), that you can
> understand the specification (often the specs are more complicated and less
> understandable than the code that meets those specs), and that the
> implementations actually meet the specification.

Of course.  These are all potential problems.  But the code for an
implementation might also have some or all of these problems as well.
In general, the language's reference document (or if they are opaque and
mysterious some reliable digest of is like a textbook) is going to be a
better option.

> I appreciate you guys taking the time to discuss interesting areas of
> compiler optimizations and so forth, and I'm not being sarcastic, but I
> wrote here with some concrete questions about Javascript. If they have been
> answered, I missed them, sorry.

That's a shame; you could try again.  If the post has only concrete
questions there may be less chance of replies getting tied up in more
speculative matters.

> Is there any analogue to Python's "is" operator, Ruby's "equal?" method, or
> Lua's "rawequal" function, in Javascript? I think the answer is No,
> although === (strict equality) comes closest, at least for objects.

No, there is nothing that really matches those identity tests.  ===
tests object identity, but because ECMAScript's object model is so
different from those other languages, it's not analogous to them in the
general case.

> When it comes to passing non-objects, is there any way to tell what calling
> convention a specific implementation is using other than reading the source
> code? Again, I think the answer is No. Am I right?

This seems to be a new question.  The semantics of function calls are
best understood from the specification (it's defined in terms of
environments and bindings) but the phrase "calling convention" usually
refers to something more low-level and implementation-specific.  If
that's what you mean, yes, you are right.  To find out how an
implementation implements calls, you pretty much have to read the code
(unless someone has written about the code of course).

-- 
Ben.

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


Thread

Identity of values in Javascript Steven D'Aprano <steve@pearwood.info> - 2015-05-22 22:47 +1000
  Re: Identity of values in Javascript Ben Bacarisse <ben.usenet@bsb.me.uk> - 2015-05-22 19:17 +0100
    Re: Identity of values in Javascript Steven D'Aprano <steve@pearwood.info> - 2015-05-23 05:02 +1000
      Re: Identity of values in Javascript Steven D'Aprano <steve@pearwood.info> - 2015-05-23 05:25 +1000
      Re: Identity of values in Javascript "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2015-05-22 23:51 +0200
      Re: Identity of values in Javascript Ben Bacarisse <ben.usenet@bsb.me.uk> - 2015-05-23 00:24 +0100
        Re: Identity of values in Javascript Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2015-05-23 09:35 +0200
          Re: Identity of values in Javascript Steven D'Aprano <steve@pearwood.info> - 2015-05-23 23:04 +1000
        Re: Identity of values in Javascript "Christoph M. Becker" <cmbecker69@arcor.de> - 2015-05-23 22:27 +0200
          Re: Identity of values in Javascript Steven D'Aprano <steve@pearwood.info> - 2015-05-25 01:58 +1000
        Re: Identity of values in Javascript Steven D'Aprano <steve@pearwood.info> - 2015-05-25 02:12 +1000
          Re: Identity of values in Javascript Ben Bacarisse <ben.usenet@bsb.me.uk> - 2015-05-24 23:33 +0100
            Re: Identity of values in Javascript Steven D'Aprano <steve@pearwood.info> - 2015-05-25 21:47 +1000
              Re: Identity of values in Javascript Ben Bacarisse <ben.usenet@bsb.me.uk> - 2015-05-26 00:10 +0100
                Re: Identity of values in Javascript Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2015-05-26 17:34 +0200
                Re: Identity of values in Javascript Ben Bacarisse <ben.usenet@bsb.me.uk> - 2015-05-26 17:03 +0100
                Re: Identity of values in Javascript Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2015-05-26 18:31 +0200
                Re: Identity of values in Javascript Steven D'Aprano <steve@pearwood.info> - 2015-05-27 23:40 +1000
                Re: Identity of values in Javascript Joao Rodrigues <groups_jr-1@yahoo.com.br> - 2015-05-27 23:21 -0300
                Re: Identity of values in Javascript "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2015-05-27 19:32 -0700
                Re: Identity of values in Javascript Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2015-05-28 22:38 +0200
                Re: Identity of values in Javascript Scott Sauyet <scott.sauyet@gmail.com> - 2015-05-26 09:06 -0700
                Re: Identity of values in Javascript Steven D'Aprano <steve@pearwood.info> - 2015-05-27 23:02 +1000
    Re: Identity of values in Javascript Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2015-05-23 00:02 +0200
    Re: Identity of values in Javascript Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2015-05-23 09:19 +0200
  Re: Identity of values in Javascript Steven D'Aprano <steve@pearwood.info> - 2015-05-23 05:20 +1000

csiph-web