Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!unmvax!ncar!tank!mimsy!cvl!haven!adm!cmcl2!lanl!jlg From: jlg@lanl.gov (Jim Giles) Newsgroups: comp.lang.misc Subject: Other syntax issues (was: language commenting constructs) Message-ID: <10582@lanl.gov> Date: 17 Mar 89 01:53:12 GMT References: <3452@ficc.uu.net> Organization: Los Alamos National Laboratory Lines: 25 From article <3452@ficc.uu.net>, by peter@ficc.uu.net (Peter da Silva): > In article <39273@oliveb.olivetti.com>, chase@Ozona.orc.olivetti.com (David Chase) writes: >> * :=/= instead of =/== > > But this definitely was. > I never liked ':=' for assignment. It has been claimed that it was selected because it _looked_like_ a left pointing arrow. It doesn't, of course, look anything like a left pointing arrow. If I'm to be forced to use two char- acters for the assignment operator (and one of them shifted no less) I would rather have '<-'. This, at least, really does look like a left arrow. Frankly, I prefer =/== to :=/=. ':=' was only chosen in the early days because some hardware didn't have '<' in the character set. > Take your pick: > > min2(a,b) { return (a < b) ? a : b; } > #define min2(a,b) (((a) < (b)) ? (a) : (b)) Obviously, I pick the first one since the second is not even correct! If either of the arguments to the macro have side-effects, the macro may return the wrong answer - and it will certainly perform at least one of the side-effects too many times.