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


Groups > comp.lang.javascript > #10736

Re: Comparing arraies

Message-ID <1660771.jP65nafYdu@PointedEars.de> (permalink)
From Thomas 'PointedEars' Lahn <PointedEars@web.de>
Organization PointedEars Software (PES)
Date 2012-01-29 17:13 +0100
Subject Re: Comparing arraies
Newsgroups comp.lang.javascript
References (4 earlier) <42ZEMLIaWtIPFwSn@J.A830F0FF37FB96852AD08924D9443D28E23ED5CD> <1634287.nPeGqDzKj4@PointedEars.de> <uFS4AjEYv9IPFwzF@J.A830F0FF37FB96852AD08924D9443D28E23ED5CD> <1946200.aqSPkdTlGX@PointedEars.de> <Re33ylGy3VJPFw81@J.A830F0FF37FB96852AD08924D9443D28E23ED5CD>
Followup-To comp.lang.javascript

Followups directed to: comp.lang.javascript

Show all headers | View raw


John G Harris wrote:

> Thomas 'PointedEars' Lahn wrote:
>> John G Harris wrote:
>>> Thomas 'PointedEars' Lahn wrote:
>>>> John G Harris wrote:
>>>>> Thomas 'PointedEars' Lahn wrote:
>>>>>> Thomas 'PointedEars' Lahn wrote:
>>>>>>> Instead of the `==' operator, the `===' operator may be used as
>>>>>>> well, but it is neither supposed to add efficiency nor would it add
>>>>>>> expressive power (both arguments are of the same type), while it
>>>>>>> certainly reduces the backwards-compatibility of the entire code.
>>>>>> _Operands_, not arguments.  We are not talking about a function, but
>>>>>> about an operator.
>>>>> Operators are also functions. How else would + be defined?
>>>> You are confusing functions with algorithms.  The subject of discussion
>>>> here is the syntax of the programming language, not the implementation
>>>> of the syntax.
>>>
>>> 1. The syntax specification calls new a keyword and + a punctuator
>>
>> No, the _lexical grammar_ of ECMAScript (Ed. 5.1) says that `new' is a
>> keyword (section 7.6.1.1), and that `+' is a punctuator (section 7.7).
> 
> So the terms 'keyword' and 'punctuator' are now available for use in
> higher layers of the language's syntax specification.

Not "now".  Those terms are far from new in the history of the ECMAScript 
Language Specification.  If only you would get yourself informed before you 
posted …

> E.g When saying that identifiers exclude keywords.

That is self-evident.  A programming language where identifiers could form a 
non-empty intersecting set with keywords would not be overly useful.  Only 
recently (Ed. 5) ECMAScript has started allowing reserved words in the dot 
property accessor notation, because in this evaluation context we *know* 
that a keyword's meaning is not intended.  It complicates parsing, though, 
as there is an additional /IdentifierName/  production now.

>>The _syntactic grammar_ calls `new' and `+' operators, as in "11.2.2 The
>>`new' Operator" and "11.6.1 The Addition operator (+)".
> 
> I'm sure you're going to find it quite difficult to prove that a section
> title is normative.

I do not have to prove that, for it is common knowledge that the section of 
a technical specification is normative unless marked differently.

> If you look closely you'll find that the text of
> such sections doesn't say which symbols comprise the 'operator'.
> E.g As in
> 
> "11.1.6 The Grouping Operator
>   The production PrimaryExpression : ( Expression ) is evaluated as
>   follows:"
> ...
> 
> The word 'operator' is used informally in the standard.

No, it is not.  In this case, it is apparent that the /Expression/ is the 
(single) operand to the Grouping Operator.

>>> Their operands/arguments are called expressions.
>>
>> Correct for "operands", in the syntactic grammar.  Operators do not have
>> arguments; functions (and by extension to OOP, methods) have them.
> 
> OOP, indeed.
> 
> In C++, the user-defined member function (aka method)

I am aware of operator overloading (e. g. in C++), but we are not discussing 
those languages or possible implementations of ECMAScript written in those 
languages.  We are discussing the syntax of ECMAScript (implementations).  
And again, in the syntax of ECMAScript, `+' is an operator; it has operands, 
not arguments.


PointedEars
-- 
Anyone who slaps a 'this page is best viewed with Browser X' label on
a Web page appears to be yearning for the bad old days, before the Web,
when you had very little chance of reading a document written on another
computer, another word processor, or another network. -- Tim Berners-Lee

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


Thread

Comparing arraies Archos <raul.san@sent.com> - 2012-01-26 07:23 -0800
  Re: Comparing arraies Martin Honnen <mahotrash@yahoo.de> - 2012-01-26 18:29 +0100
    Re: Comparing arraies Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2012-01-26 19:50 +0100
      Re: Comparing arraies Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2012-01-26 19:54 +0100
        Re: Comparing arraies John G Harris <john@nospam.demon.co.uk> - 2012-01-27 16:49 +0000
          Re: Comparing arraies Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2012-01-27 18:41 +0100
            Re: Comparing arraies John G Harris <john@nospam.demon.co.uk> - 2012-01-28 11:28 +0000
              Re: Comparing arraies Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2012-01-28 21:17 +0100
                Re: Comparing arraies John G Harris <john@nospam.demon.co.uk> - 2012-01-29 14:55 +0000
                Re: Comparing arraies Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2012-01-29 17:13 +0100
                Re: Comparing arraies John G Harris <john@nospam.demon.co.uk> - 2012-01-30 15:27 +0000
                Re: Comparing arraies Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2012-01-30 19:03 +0100
                Re: Comparing arraies John G Harris <john@nospam.demon.co.uk> - 2012-01-31 15:07 +0000
                Re: Comparing arraies Dr J R Stockton <reply1205@merlyn.demon.co.uk> - 2012-01-31 18:51 +0000
                Re: Comparing arraies "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2012-01-30 12:01 -0800
                Re: Comparing arraies John G Harris <john@nospam.demon.co.uk> - 2012-01-31 11:06 +0000
                Re: Comparing arraies "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2012-01-31 06:08 -0800
                Re: Comparing arraies John G Harris <john@nospam.demon.co.uk> - 2012-01-31 16:08 +0000
                Re: Comparing arraies "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2012-01-31 18:32 -0800
                Re: Comparing arraies John G Harris <john@nospam.demon.co.uk> - 2012-02-01 17:02 +0000
                Re: Comparing arraies "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2012-02-01 10:07 -0800
                Re: Comparing arraies John G Harris <john@nospam.demon.co.uk> - 2012-02-02 15:10 +0000
                Re: Comparing arraies "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2012-02-02 11:16 -0800
                Re: Comparing arraies John G Harris <john@nospam.demon.co.uk> - 2012-02-07 15:14 +0000
                Re: Comparing arraies Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2012-02-01 21:45 +0100
                Re: Comparing arraies "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2012-02-01 13:07 -0800
                Re: Comparing arraies Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2012-02-01 23:44 +0100
                Re: Comparing arraies "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2012-02-01 18:22 -0800
                Re: Comparing arraies Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2012-02-02 23:09 +0100
                Re: Comparing arraies Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2012-02-03 01:47 +0100
                Re: Comparing arraies John G Harris <john@nospam.demon.co.uk> - 2012-02-04 10:34 +0000
                Re: Comparing arraies Dr J R Stockton <reply1205@merlyn.demon.co.uk> - 2012-02-05 16:47 +0000
                Re: Comparing arraies John G Harris <john@nospam.demon.co.uk> - 2012-02-06 15:21 +0000
                Re: Comparing arraies "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2012-02-04 23:37 -0800
    Re: Comparing arraies Denis McMahon <denismfmcmahon@gmail.com> - 2012-01-26 23:08 +0000
      Re: Comparing arraies Denis McMahon <denismfmcmahon@gmail.com> - 2012-01-27 01:42 +0000
        Re: Comparing arraies Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2012-01-27 11:41 +0100
      Re: Comparing arraies Gene Wirchenko <genew@ocis.net> - 2012-01-26 16:24 -0800
        Re: Comparing arraies "Evertjan." <exjxw.hannivoort@interxnl.net> - 2012-01-27 08:50 +0000
      Re: Comparing arraies Dr J R Stockton <reply1204@merlyn.demon.co.uk> - 2012-01-27 21:07 +0000
        Re: Comparing arraies "Evertjan." <exjxw.hannivoort@interxnl.net> - 2012-01-28 13:45 +0000
  Re: Comparing arraies "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2012-01-26 16:21 -0800
    Re: Comparing arraies Martin Honnen <mahotrash@yahoo.de> - 2012-01-27 16:00 +0100

csiph-web