Path: utzoo!attcan!uunet!husc6!uwvax!rutgers!bellcore!texbell!sugar!ficc!peter From: peter@ficc.uu.net (Peter da Silva) Newsgroups: comp.lang.misc Subject: Re: colon-equal vs equal Message-ID: <2567@ficc.uu.net> Date: 27 Dec 88 06:12:58 GMT References: <3300001@uxg.cso.uiuc.edu> <3290002@hpctdls.HP.COM> Organization: Xenix Support Lines: 20 In article <3290002@hpctdls.HP.COM>, rbk@hpctdls.HP.COM (Richard Katz) writes: > as a boolean operator and := as asignment. First, := seems better > since i = i + 1 looks real funny. 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. FORTRAN uses .EQ. to make sure that there is no mixup This has nothing to do with :=/= versus =/==. This has to do with C being an expression-based language and Pascal being a statement-based language. There are expression-based languages which use := and allow you to say things like "if flag := f1 and f2 then...". Just so long as you have two tokens. If you want to flame a language, try BASIC ("if a = b then a = c"... the first is a comparison, the second an assignment). -- Peter da Silva, Xenix Support, Ferranti International Controls Corporation. Work: uunet.uu.net!ficc!peter, peter@ficc.uu.net, +1 713 274 5180. `-_-' Home: bigtex!texbell!sugar!peter, peter@sugar.uu.net. 'U` Opinions may not represent the policies of FICC or the Xenix Support group.