From: Donal K. F. <don...@ma...> - 2006-11-05 22:59:09
|
Will Duquette wrote: > Alternatively, if one used ":=" as the assignment operator for > TIP 282 there'd be no active harm in using the enhanced syntax > in "if" and "while". You *could* write "if {a := $b}" if you > really wanted to, but you'd be much less likely to do it > accidentally. I agree with and strongly support this suggestion. Many years of experience with C and Java (learning, using, and teaching) tells me that the "BCPL mistake"[*] is a horrible thing that always leads to trouble. If we ensure that "=" is not legal, it forces people to choose between definitely equality (==) and definitely assignment (:=). I've done this in the past in other languages, and it makes for fewer user errors. Donal. [* Many people think this is a problem that came about in the C language but it really happened in C's grandparent. Or maybe it was in CPL, the parent language of BCPL, but I can't find any examples of that online in a quick and not-very-thorough search. ] |