Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.3 4.3bsd-beta 6/6/85; site ucbvax.ARPA Path: utzoo!watmath!clyde!burl!ulysses!ucbvax!daemon From: mwm@ucbopal.CC Newsgroups: net.lang.c Subject: Re: No Such Thing Message-ID: <10176@ucbvax.ARPA> Date: Sat, 24-Aug-85 00:19:51 EDT Article-I.D.: ucbvax.10176 Posted: Sat Aug 24 00:19:51 1985 Date-Received: Sun, 25-Aug-85 00:54:23 EDT Sender: daemon@ucbvax.ARPA Organization: University of California at Berkeley Lines: 79 From: Mike (I'll be mellow when I'm dead) MeyerI have avoided posting (for the most part) recently, but: In 868@brl-tgr.ARPA jim cottrell (cottrell@nbs-vms.ARPA) says: > Flame On! THERE IS NO SUCH THING AS A BOOLEAN!!! Flame Off. :-) Ok, we now know that jim doesn't believe in true and false. Does he drop right and wrong at the same time? How about write and read? :-) > In case you hadn't noticed, `<' & company are infix operator that > return a constant `zero' or `one'. Thus, *every* conditional using > the `boolean' operators ultimately reduces to either > if (0) { ... } or if (1) { ... } > THIS IS NOT A KLUDGE! It is the WAY IT SHOULD BE! What could be > more mnemonic (except to a nihilist :-) than TRUE if nonzero, and > FALSE if zero. One of C's design virtues is that it is minimal, yet > (relatively) complete. Don't drag outmoded concepts into the future! TRUE if nonzero, FALSE if zero? Sounds like jim just built a map from the set of C integers to booleans. But booleans don't exist, so such a map can't exist. Maybe what jim meant was: if (expression) { ... } is the same as: if expression is non-zero then { ... }. BTW, for something more mnemonic that 0 -> FALSE, {x | x /= 0} -> TRUE, how about nil -> FALSE, {x | x /= nil} -> TRUE, or {x | x = 0 mod 2} -> TRUE, {x | x = 1 mod 2} -> FALSE? Second BTW: C is not minimal. It's not bad, but there a half-dozen or so languages that have fewer operators, and equivalent completeness. Most of those are harder to use than C, though. > > Many Boolean expressions are not best thought of as comparison of > > an arithmetic quantity against zero. For example: > > while ( ! Done() ) > > Perform_Action(); > > We agree, but for different reasons. You insist on dragging in > an outmoded concept, then complaining that it doesn't fit very well. > I just read what it says. Sorry, but you've got it backwards. He's trying to pull a modern concept (TRUTH :-) into an obsolete language. Of course, if your language is nothing more than a high-level assembler, then using the funny "zero is false" map is ok, providing the underlying hardware doesn't provide a boolean type of it's own. > > I am pretty conservative > > I think this pretty much sums it up. Yeah - somebody who expects the programming languages to make their job easier is pretty conservative. I'm that way to - I want a language that makes it easy to turn my thoughts into code. This is why I prefer ALGOLW or C to FORTRAN or BASIC, and CLU or LISP to ALGOLW or C. > Actually, Doug, I'm not so much writing this to you as much as > all those other people out there who insist on fortrash as a model > for all their computing. Sorry about the cheap shot, but I wish you > were a little more daring in your philosophy. K & R were. Sorry, but I can't resist: Jim, from where I stand, *you* insist on fortrash as a model for your computing. There are more similarities between C and fortrash than differences. The C "if x is zero then ..." reminds me of the fortrash arithmetic if. But further discussion belongs in net.lang.*