what to think of relationals and assignments

Wayne Throop throopw at sheol.UUCP
Sun Sep 16 07:01:24 AEST 1990


> From: bruce at seismo.gps.caltech.edu (Bruce Worden)
> I would think of `:=' as `equals', too, along with almost any
> other symbol that did the same job.  If you really want to emphasize the
> assignment nature of expressions like `x = y;', then an equal sign has no
> place in the symbol you use to do it.  How about `let x take on the value of
> y;'?  No ambiguity there.)

Well, there are three things I know of that equal-like symbols often do
in programming languages: implicative (assert that an equality is so, so
this fact can be used in reasoning, or in calculating values in either
direction, examples of this usage in mathematics and prolog-like
languages), inquisitive (test whether an equality is so or not), and
imperitive (command that a reference take on a value).  (Of course,
things are more complicated than this, but this will suffice.)

Just as a precaution against sloppy thinking, the mutterings I use
to remember incantations of these three sorts are

           "foo  IS  bar"    (while thinking implicative)
           "foo EQUALS bar"  (while thinking inquisitive, 
                                     ofen preceeded by "if")
           "foo GETS bar"    (while thinking imperitive)

When typing any particular language, I let my fingers remember that
"gets" might be spelled "=" and "equals" ".EQ.".

( I am, by the way, open to suggestions for improving these incantation
  mnemonics.  I'm no more married to them than I am to pronouncing "*"
  "splat", or "!" "bang" (although that's a different level of abstraction
  completely....).  I'm especially unsatisfied with the "is". )

Just a thought.
--
Wayne Throop <backbone>!mcnc!rti!sheol!throopw or sheol!throopw at rti.rti.org



More information about the Comp.lang.c mailing list