Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!rutgers!cs.utexas.edu!uunet!mcvax!ukc!axion!skilbane From: skilbane@zaphod.axion.bt.co.uk (Steven Kilbane) Newsgroups: comp.lang.c Subject: Re: comma operator Message-ID: <2117@zaphod.axion.bt.co.uk> Date: 2 Aug 89 07:33:40 GMT References: <918@helios.toronto.edu> Sender: news@axion.bt.co.uk Reply-To: skilbane@zaphod.axion.bt.co.uk Lines: 31 From article <918@helios.toronto.edu>, by dooley@helios.toronto.edu (Kevin Dooley): > Can anybody tell me if there is a usage where the comma is 'better'. > By this I mean are there any places where using a comma makes the > code more readable, efficient, produce cleaner/faster assembler (I > know this is compiler dependant). It's just that I've never seen a > program with the comma operator where I didn't scream and edit it out. > Am I being hopelessly pedestrian here? Well, in addition to the points about macro use, my own _personal_ feeling is that it can highlight associations: 1 x=5; for (c='k';...;..) { 2 for (x=5,c='k';...;..) { Now, to me, the first form indicates that c will be used in the loop, and that x might be. The second strongly hints that both c and x will be used in the loop. I dunno - maybe I'm just sick. -oOo-oOo-oOo-oOo-oOo-oOo-oOo-oOo-oOo-oOo-oOo-oOo-oOo-oOo-oOo-oOo-oOo-oOo-oOo-oOo Stephen Kilbane |Email: skilbane@uk.co.bt.axion British Telecom Research Laboratories|or smk-a@uk.ac.york.minster (or, if that Martlesham Heath |doesn't work, root@uk.ac.york.softeng - Ipswich IP5 7RE (0473 646638) |not me, but it may be passed on.... -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= Disclaimer: Who? Me? Nah - must have been someone else when my back was turned! Quotes: "If silence is golden, music is platinum" "'You haven't lived till you've died in MUD' - I live a lot!" "(If platinum is to gold, what is to golden?)"[This space to rent]