On Sunday 26 October 2003 10:13, Greg Ewing wrote:
Hardly arbitary (I have fond memories of several languages that used :=).
But all the ones I know of use it for ordinary assignment. We'd be having two kinds of assignment, and there's no prior art to suggest to suggest which should be = and which :=. That's the "arbitrary" part.
The only language I can remember seeing which had two kinds of assignment was Simula, which had := for value assignment and :- for reference assignment (or was it the other way around? :-) I always thought that was kind of weird.
VB6 had LET x = y for value assignment and SET x = y for reference assignment. Yes, very confusing particularly because the LET keyword could be dropped. Fortunately we're not proposing anything like that;-).
Icon had := for irreversible and <- for reversible assignment. (also :=: and <-> for exchanges and diffferent comparisons for == and === so maybe it HAD gone a bit overboard:-).
I do recall an obscure language where <op>= was always augmented assignment equivalent to a = a <op> b. But in particular the : operator meant to evaluate two exprs and take the RH one, like comma in C, so a := b did turn out to mean the same as a = b BUT fail if a couldn't first be evaluated, which (sort of randomly) is sort of close to Just's proposal. Unfortunately I don't remember the language's name:-(.
Googling a bit does show other languages distinguishing global from local variable assignments. E.g, in MUF, http://www.muq.org/%7Ecynbe/muq/muf1_24.html , --> (arrow with TWO hyphens) assigns globally, -> (arrow with ONE hyphen) assigns locally.