[686] in Coldmud discussion meeting

root meeting help first first in chain previous in chain previous next next in chain last in chain last

Re: assignment operator

daemon@ATHENA.MIT.EDU (Fri Mar 10 01:48:17 1995 )

Date: Thu, 9 Mar 95 22:42:52 -0800
From: jsp@betz.biostr.washington.edu (Jeff Prothero)
To: coldstuff@MIT.EDU


| >
| > < Personally, I'd prefer :=..  It's already used in at least one
| language for
| > < this purpose
| >
| > VMS's DCL (Digital Command Language, aka VMS shell) uses ':==' to
| set symbols
| > (i.e. make an assignment, of sorts).
| 
| Yuck, if anything, do NOT use DCL as a base or to get ideas for
| anything. :P

I think these endless squabbles over syntactic minutia
are a good reason to put compilers in-db rather than
inserver, personally :).

For what it's worth:

-> I believe DCL uses both := and :== to mean different
   but similar things (some sort of global/local distinction?)

-> I've been using "->" as an assignment operator in
   Muq's MUF syntax (RPN, so the variable assigned to
   sits on the right ... what's the logic behind putting
   the destination on the left in infix languages, anyho?)
   and nobody has complained about it yet... several people
   have commented favorably.  I'd go for <- in this sort of
   case, unless += -= etc are being supported... -<- and
   +<- and so forth just don't do it for me.

-> One relevant design principle is Zipf's Law:  the
   most frequently used operators should have the
   shortest representations.  I think this is one of
   the best arguments for using '=' rather than a
   digraph.

-> I agree the = / == resemblance is bad.  I've been hacking
   C pretty solidly since '78, and it _still_ gets me from
   time to time.  Mostly because I mentally convert from
   internal to verbal to typewritten, and the last stage is
   done unconciously, and both "=" and "==" get "equals"
   as verbal representation.  I'm working on saying "gets"
   for "=", currently... :)

-> Nobody has suggested Prolog's :- yet.  Be a shame to
   leave any existing religions out of the debate :)

-> A solution I haven't seen tried is to use '=' for >both<
   assignment and comparison, and to keep the contexts in
   which they are allowed mutually exclusive.  This
   wouldn't be impractical, I don't think, although Cfolk
   might dislike the restriction.  I doubt novice hackers
   would.

Cynbe