Path: utzoo!attcan!uunet!husc6!cmcl2!rutgers!tut.cis.ohio-state.edu!osu-cis!att!ihlpb!nevin1 From: nevin1@ihlpb.ATT.COM (Liber) Newsgroups: comp.lang.misc Subject: Re: colon-equal vs equal Keywords: Oh no not again! :-) Message-ID: <9282@ihlpb.ATT.COM> Date: 28 Dec 88 01:29:47 GMT References: <3300001@uxg.cso.uiuc.edu> <3290002@hpctdls.HP.COM> Reply-To: nevin1@ihlpb.UUCP (55528-Liber,N.J.) Organization: AT&T Bell Laboratories - Naperville, Illinois Lines: 26 In article <3290002@hpctdls.HP.COM> rbk@hpctdls.HP.COM (Richard Katz) writes: >I don't know how the := came into being, but I don't have any beef >about it. In fact, I think Pascal use of it is good. Pascal uses = >as a boolean operator and := as asignment. First, := seems better >since i = i + 1 looks real funny. It looks funny to me, too. I much prefer "i += 1", but I don't remember augmented assignment being legal in Pascal. >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. This really has nothing to do with ":=" vs "=". C is an expression-based language; Pascal is not (by expression-based I mean that every operator returns a value that can be used as one of the parameters for another operator). In Pascal, just about (ie, I'm not 100% sure :-)) every use of ":=" could be replaced by "=" with no ambiguities arising (please don't flame me if there is an exception to this statement; it would not be difficult to change the language so that none of these ambiguities arise). Heck, even my TRS-80 Model I Level II BASIC could differentiate between these two cases! :-) -- NEVIN ":-)" LIBER AT&T Bell Laboratories nevin1@ihlpb.ATT.COM (312) 979-4751