Newsgroups: comp.lang.misc Path: utzoo!utgpu!jarvis.csri.toronto.edu!dgp.toronto.edu!flaps From: flaps@dgp.toronto.edu (Alan J Rosenthal) Subject: Re: colon-equal vs equal Message-ID: <8812270436.AA12924@explorer.dgp.toronto.edu> Organization: Dynamic Graphics Project, University of Toronto References: <3300001@uxg.cso.uiuc.edu> <3290002@hpctdls.HP.COM> Date: Mon, 26 Dec 88 23:36:07 EST In article <3290002@hpctdls.HP.COM> rbk@hpctdls.HP.COM (Richard Katz) writes: >First, := seems better since i = i + 1 looks real funny. C's solution to that is to introduce ``i += 1''. (Well, C didn't invent this I don't believe but it has it.) >Also, a nice feature is that 'if ( i := 10 )' will produce a syntax error in >Pascal while 'if ( i = 10 )' will produce an assignment in C, usually not >intended. No, this is not because of the different characters which make up the operator. This is because in C an assignment statement is an expression and in Pascal it is not. This is a completely separate question. (I personally think ``assignment'' and ``embedded assignment'' operators should look different, something I've never seen in the real world.) ajr -- "The goto statement has been the focus of much of this controversy." -- Aho & Ullman, Principles of Compiler Design, A-W 1977, page 54.