[net.lang.c] '=' vs '<-' vs '.ne' vs '==' vs ':=' vs '.eq.' vs ...

gaynor@topaz.RUTGERS.EDU (Silver) (07/05/86)

[Line-Eater, hear me!  Eat this message, or I'll be flamed for sure!]

I've been following this discussion with polite attention, and decided
what the hell, here's my two cents (probably the value of the opinions
anyway, hee-yuk).

I give my preferences, and why.

ASSIGNMENT  <-

It visually seems more consistent with the programming paradigm, 'move
this value there'.  Mathematically, '=' is usually interpreted as 'it
is asserted that these two expressions are equal'.  To illustrate, can
you imagine what errors C or Pascal would generate on a statement like
x * x = 9?  Of course, it's a totally different story with an
assertive, relational language.  In addition, I don't care that it's
two strokes.  If I *really* minded, I would set-key-globally a
rarely-used key like '`' from self-insert to insert-<the-desired-
operator-of-more-than-one-character> (emacs is real nice about things
like this).

EQUALITY  =

Now, with '=' free, it can be used in a way more like it's
mathematical interpretion ('it is asserted...').

INEQUALITY  <>

I like it's visual symmetry, giving each side of the expression the
'half-operator''s mirror image of the other side (hard to express, you
know what I'm trying to say - neither side is favored).  Not so with
'!=', '~=', '|=', ...  Another connotation is that it is a 'true'
assertion, rather than a 'false' one.  That is, a <> b is literally
read as 'a is less than or greater than b', whereas a != b is read as
'a is not equal to b'.

By the way, do(es) any language(~s) implement these choices?

Go ahead then.
postnews re: "...!topaz!gaynor re: '=' vs '<-' vs ..." \
  | much-hellfire-and-brimstone


                         _   /|
                         \`o_O'
                           ( )   Aachk! Phft!   
                            U

Disclaimer: The opinions and/or information and/or code expressed
            here were generated by this characature, stolen from
            Dave Rasmussen, to which I have taken the liberty of
            adding ears.  So don't look to me for a disclaimer!

Silver  {...!topaz!gaynor}

bzs@bu-cs.UUCP (Barry Shein) (07/05/86)

Seriously folks, how many angels *can* fit on the head of a pin...

franka@mmintl.UUCP (Frank Adams) (07/08/86)

In article <5282@topaz.RUTGERS.EDU> gaynor@topaz.UUCP writes:
>ASSIGNMENT  <-

The problem is that "<-" is a legal sequence of operators.  Consider
"if (x<-1) { ...}".

Frank Adams                           ihnp4!philabs!pwa-b!mmintl!franka
Multimate International    52 Oakland Ave North    E. Hartford, CT 06108

geoff@suneast.uucp (Geoff Arnold) (07/09/86)

>>Path: ..!topaz!gaynor (Silver @ Rutgers Univ., New Brunswick, N.J.)
>>
>>I give my preferences, and why.
>>
>>ASSIGNMENT  <-
>>
>>It visually seems more consistent with the programming paradigm, 'move
>>this value there'.  

Well, to my mind the only language that ever got it RIGHT was POP-2:

	Rvalue -> Lvalue

(yeah, I know that using Rvalue and Lvalue in this context is bizarre...).
It seems more consistent with the sequential nature of the language
(sorry - English chauvinism strikes again).  Using the usual

	Lvalue <assignment_op> Rvalue

form always looks as though we're a bit ashamed of the fact that these
languages are procedural... After all, the first time most kids get to
write textual material of the form

	SOMETHING = SOMETHING_ELSE
	...

is in elementary algebra (that is, until they started teaching Basic
two grades earlier than algebra... [sigh]), in which the "=" sign is
perceived as having both logical (axiomatic) and textual (macro
definition) uses. (This from talking to average kids who have been
through a year of algebra.)

Not that I'm advocating the POP-2 untyped stack model, in which
Forth-like swapping was really easy

	A, B ->A ->B

Take THAT, `lint'! :-)

-- 
"disclaimo, disclaimas, disclaimat, disclaimamus, disclaimatis, disclamant"
UUCP:      {hplabs,ihnp4,nsc,pyramid,decwrl}!sun!suneast!hinode!geoff

gaynor@topaz.UUCP (07/12/86)

[ Viewer discretion is advised.  The following ]
[ material may be found offensive...           ]

Frank Adams (franka@mmintl.UUCP) writes:

> The problem is that "<-" is a legal sequence of operators.  Consider
> "if (x<-1) { ...}".

I never said that I was specifying C operators.  What I posted was a
list of how I PREFER the operators, not necessarily how I have them in
any given language.  I assume that there are textual replacement and
definition mechanisms in C strong enough to allow me to have things
the way I want them.  (I've seen the 'pig' prefix thrown around quit a
bit.)  You see, I know very little C, and, from what I've seen, I
don't like it very much.  However, it IS a powerful algorithmic
language, no doubt.  The operators in question upon which I posted are
are the ones I generally use when writing pseudo.

The main reason I read this newsgroup is not because I like the penny-
ante discussions that are raged on the obscure and system-dependant
features (bugs?) of C.  It just happens that some topics which better
belong in net.lang are discussed here.  As far as languages go, I
think K&R left much to be desired in the overall design of C.

I don't care to be flamed, by the way, for holding an opinion.  Just
to give an indication of where they'll be routed to.  This does not
mean that I'm closed to discussion - just melee.


                         _   /|
                         \`o_O'
                           ( )   Aachk! Phft!   
                            U

Disclaimer: The opinions and/or information and/or code expressed
            here were generated by this characature, stolen from
            Dave Rasmussen, to which I have taken the liberty of
            adding ears.  So don't look to me for a disclaimer!

Silver  {...!topaz!gaynor}

ps I disclaim all the views above for Dave Rasmussen.

jsdy@hadron.UUCP (Joseph S. D. Yao) (07/19/86)

In article <5282@topaz.RUTGERS.EDU> gaynor@topaz.RUTGERS.EDU (Silver) writes:
>By the way, do(es) any language(~s) implement these choices?
Yes.

>ASSIGNMENT  <-
PPL, ECL, some ASCII-ised APL's, several other languages.

>EQUALITY  =
Most ALGOLische languages.  BASIC.  Likely, others.

>INEQUALITY  <>
BASIC.  At least one other.
-- 

	Joe Yao		hadron!jsdy@seismo.{CSS.GOV,ARPA,UUCP}
			jsdy@hadron.COM (not yet domainised)