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.1 required=5.0 tests=BAYES_05,REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 109fba,b87849933931bc93 X-Google-Attributes: gid109fba,public X-Google-Thread: fac41,b87849933931bc93 X-Google-Attributes: gidfac41,public X-Google-Thread: 103376,b87849933931bc93 X-Google-Attributes: gid103376,public X-Google-Thread: 114809,b87849933931bc93 X-Google-Attributes: gid114809,public X-Google-Thread: 1108a1,b87849933931bc93 X-Google-Attributes: gid1108a1,public From: Richard Katz Subject: Re: Definition of "operator" (was: OO, C++, and something much better!) Date: 1997/02/23 Message-ID: <3310948B.29C1@earthlink.net> X-Deja-AN: 220900250 References: <5de62l$f13$1@goanna.cs.rmit.edu.au> Content-Type: text/plain; charset=us-ascii Organization: Earthlink Network, Inc. Mime-Version: 1.0 Reply-To: richkatz@earthlink.net Newsgroups: comp.lang.c++,comp.lang.smalltalk,comp.lang.eiffel,comp.lang.ada,comp.object X-Mailer: Mozilla 3.0Gold (Win95; I) Date: 1997-02-23T00:00:00+00:00 List-Id: Alan Lovejoy wrote: > > 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? Alan, I think you're on to something. You could say that operators are simply operations for which there is a character infix rather than a functional prefix notation. I'm concerned with something slightly different: the hierarchy of operators. But I think the discussion is ueeful in telling us something about operators themselves. If we look at "operator" in it's historical context 1) in it's mathematical history 2) as a computer language implementation, and 3) in terms of methods of computation, we find: 1) In a historical context, the hierarchy of operators came from trade. It was easier to represent 52 sheep as "5 10's plus 2", 5 x 10 + 2 because this was the way they were counted off at both send and delivery. So mathematical operators, and their hierarchy have a historical context. But we would have to look very hard to find a similar history for other operators or operations such as ssy, string operators. But what about logical operators? In human terms, "or" is usually local (applied first) while "and" is global (applied later). "Doctors or Nurses in Minnesota or Wisconsin" in human terms means (Doctor or Nurse) AND (Minnesota or Wisconsin). But this hierarchy is rarely if ever represented in computer language. If any hierarchy exists, it usually that AND is local and so defeats the human intent, thereby making computer languages (including SQL) less tractable to the average human. 2) Early attempts at implementing computer language operators in the FORTRAN language were to capture human mathematics. Thus the human hierarchy of mathematical operators was also emulated in FORTRAN, and numerous follow-on languages. Whether this needs to be so or not is a matter of language purpose. Other languages have different purposes and philosophies. Note that the APL language extends the operator notation but eliminates hierarchy. It considered that all kinds of operations were symbolized by single or short multiple characters and could be used as infix or prefix. Between C and C++ there is a major difference. The "routing" purpose of operators built into both C and UNIX is extended in C++ so that the concept of overloading makes operators into methods with different notation. In the PROLOG language, many non-PROLOG constructs and operator hierarchies can be represented. As a result, my answer to your question becomes: 1) There need be no fundamental difference between operators and operations. 2) However, operators have a historical context which the language may or may not choose to represent, and 3) within that context operators have hierarchy which might be difficult to extend to all operations or even all operators. 3) Computation. The definition of "computing machine" and "computing language" have grown concurrently. Realize, that idea "virtual machine," or machine concept in no way belongs strictly to Java. Pascal, C, Prolog, and LISP have or have had machine concepts or VMs. Both FORTRAN as a mathematical represntation, and simply "internally programmmed computer" were based on a machine concept - not on a machine. The machine and how it would be programmed grew over a twenty year process before one was actually created and programmed. Due to computation method, representations such as FORTRAN, while useful, are not totally compatible with human mathematics, "Assignment" is not the same as "premise." As a premise you might state: X = 7 3*Y = X+4 PRINT Y However, in Fortran, you could never state "3*Y = X+4" because the equal operator is simply an assignment, and you can't assign something to "3 times Y." This being an unsatisfactory outcome of FORTRAN, computer scientists went on to define symbolic processing languages such as FORMAC, FORMAL, and other mathematical languages. Even so, while other computation operators have a math heritage, the "=" operator generally does not. Instead, "=" most generally conveys the placement of a value into a memory location. The fact that this memory location is referred to as a "variable" makes it so only in the context of a complete program, not in the context of expressing mathematical formula. Thus, if you were to try to change the meaning of "=" to denote premise equality, you would want a machine that likewise conveys premise equality rather than assignment and variables to be real variables rather than memory locations. I would suggest that premise equality, operator hierarchy, and thus operators themselves belong to the study of NL, in that they are representations of reality expressed in language. If some OO implementation chose to try to do the same thing, that would be quite interesting. One question I would have is whether some of the extensions would be culturally and even memetically bound. The near universal acceptance of "=" to mean assignment in computer language might be a meme which is itself an example and subclass of the historic relationship between machine and language. Attempts to redefine "operator" within an OO language would be well advised to consult history and human usage. Richard Katz