[whatwg] 2.3 editorial: operators, operations, or ?
Tab Atkins Jr.
jackalmage at gmail.com
Sat Aug 15 07:32:29 PDT 2009
On Sat, Aug 15, 2009 at 8:16 AM, Elliotte Rusty
Harold<elharo at ibiblio.org> wrote:
> On Sat, Aug 15, 2009 at 4:40 AM, Ian Hickson<ian at hixie.ch> wrote:
>> On Mon, 10 Aug 2009, Elliotte Rusty Harold wrote:
>>> "This specification defines several comparison operators for strings."
>>> Really, operators? Is this the right word here? Maybe it should be
>>> "several comparison operations on strings" or "several possible
>>> comparisons for strings.
>> What's wrong with operators? They are literally functions that the rest of
>> the spec uses, it seems like the right word here.
> A function is not an operator. According to Wikipedia, "In
> mathematics, an operator is a function which operates on (or modifies)
> another function." A comparison is an operation on strings (data), not
> on other functions.
> In traditional programming languages such as Java and C, an operator
> is usually a language defined symbol, and occasionally a user defined
> symbol. That also doesn't apply here. For instance, in Java,
> "operators are special symbols that perform specific operations on
> one, two, or three operands, and then return a result."
> What you're describing is likely a function or perhaps an operation,
> but I don't think it's an operator in the commonly understood senses
> of the term amongst the people likely to be reading this spec.
The term 'operator' *is* sometimes used to just mean 'function' in
functional languages. The term 'comparison operator' in specific is
fairly normal in my experience.
More information about the whatwg