From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fac41,b87849933931bc93 X-Google-Attributes: gidfac41,public X-Google-Thread: 109fba,b87849933931bc93 X-Google-Attributes: gid109fba,public X-Google-Thread: 1108a1,b87849933931bc93 X-Google-Attributes: gid1108a1,public X-Google-Thread: 103376,b87849933931bc93 X-Google-Attributes: gid103376,public X-Google-Thread: 114809,b87849933931bc93 X-Google-Attributes: gid114809,public From: jsa@alexandria (Jon S Anthony) Subject: Re: Definition of "operator" (was: OO, C++, and something much better!) Date: 1997/02/18 Message-ID: #1/1 X-Deja-AN: 219493326 Sender: news@organon.com (news) References: <5de62l$f13$1@goanna.cs.rmit.edu.au> Organization: Organon Motives, Inc. Newsgroups: comp.lang.c++,comp.lang.smalltalk,comp.lang.eiffel,comp.lang.ada,comp.object Date: 1997-02-18T00:00:00+00:00 List-Id: In article <330789FA.40A5@concentric.net> Alan Lovejoy writes: > Jon S Anthony wrote: > > > > Generally speaking, the terms "operator" and "operation" are used to > > refer to functions which map an "n-order" set to the "base" or > > "1-order" set. Let A be a set and A^n be the cross product of A with > > it self n times (n could be 1). If f is a function from A^n to A, > > f:A^n -> A, then f is an "n-ary operation". For example, addition is > > a simple binary operation on N (set of naturals). The identity > > operation is a simple unary operation for any set. Strictly speaking, > > the term "operator" is used to refer to the particular symbol for the > > operation, but in practice (outside a strictly formal account) this is > > typically "slopped over". > > Ok. > > So here's a theory: the term "operator" in programming languages was > coined by applying it to those built-in procedures which were > intended to be analogs of math functions that formally qualify as > "operations." Later, other "built-in" procedures also got called > "operators" by (uninformed) analogy. That's probably pretty much what happened. It would be interesting to hear from Robert Dewar on this as he seems to have a lot of insight (inside info?) on the history of programming language design. > If the theory is true, then a case could be made that a procedure > should be called an "operation" (and its name an "operator") if its > math analog formally qualifies as an "operation" (a function whose > domain is an n-order set and whose range is a 1-order set, such as > "f(Complex, Complex): Complex"). Just to be clear, the range is not just any ol' "1-order set" it's the same set used in defining the n-order domain set. What I'm having trouble with here (and in the discussion that prompted this new thread) is what distinguishing the notions of "operator" and "operation" buys you in the context of CS/PLs. I'm not saying it's worthless, I'm just not clear on why people think it is useful here. > Also, if the proposed definition of "operator/operation" is adopted, > what would be a good term for tokens such as "return" (in C or C++), > or the return ("^") and assignment (":=") symbols in Smalltalk, that > represent "built in" actions whose semantics are defined by the > language? "Intrinsics"? But then, I think this term is already used for various other things... > So the question is: shat should the terms "operator" and "operation" > mean in computer science? Do you think the meaning of these terms > should or should not be anologous to their meaning in math? Why or > why not? Shouldn't the first questions be: What use is there in distinguishing these terms in CS/PLs? And, why would you want to do that (what's the point)? /Jon -- Jon Anthony Organon Motives, Inc. Belmont, MA 02178 617.484.3383 jsa@organon.com