Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 6/24/83; site ubc-cs.UUCP Path: utzoo!watmath!clyde!burl!ulysses!mhuxr!mhuxt!houxm!ihnp4!alberta!ubc-vision!ubc-ean!ubc-cs!manis From: manis@ubc-cs.UUCP (Vince Manis) Newsgroups: net.lang.c Subject: Re: Use of expression values in C Message-ID: <1142@ubc-cs.UUCP> Date: Wed, 10-Jul-85 12:04:08 EDT Article-I.D.: ubc-cs.1142 Posted: Wed Jul 10 12:04:08 1985 Date-Received: Sat, 13-Jul-85 10:01:43 EDT References: <474@crystal.UUCP> <397@umcp-cs.UUCP> <721@wlcrjs.UUCP> <5755@utzoo.UUCP> <685@lll-crg.ARPA> <5764@utzoo.UUCP> Reply-To: manis@ubc-cs.UUCP (Vince Manis) Organization: UBC Department of Computer Science Lines: 13 Summary: I must agree with Henry Spencer that readability is not a Boolean type (I doubt it's even an ordered type!). However, the question of embedded assignment is not entirely onesided. For some time, I have been using a construct which I call a ``guarded command'' (and is indeed something vaguely like Dijkstra's guarded commands): if ((fp = fopen(...) != NULL) { ... Do something; fp does indeed have a value ... } The idea is that the if-statement protects the statements of the block. I find this an extremely readable way of stating constraints about the validity of variables over sequences of code.