Article View: comp.std.c
Article #3654Re: Incrementing a bool
From: halasz
Date: Fri, 04 Aug 1995 19:46
Date: Fri, 04 Aug 1995 19:46
35 lines
2214 bytes
2214 bytes
In article <3vq4uf$2lh@gabi.gabi-soft.fr>, kanze@gabi-soft.fr (J. Kanze) writes
: My argument centers on types. Something with a logically false value
: also has a logically true value, and no other values. True and false
: are not numeric values, nor are they pointers, and it makes no sense to
: declare them as such.
No, there are as manie valus as one wants between "true" and "false", and
this shows up even in ordinarie C-programming. There is no need for the near
equivalent of this,
typedef enum { false, true } bool;
when it depnds on the program, hou finelie to divide "truth".
: With flags, I agree. But then, my flags always have names like
: `isSomethingOrOther', with immediatly identify them as logical
: predicates.
:
: Again, a flag has two possible values: true and false. The number of
: operations on a flag is limited. A flag is a logical predicate, and I
: want the compiler to scream if I accidentally write `flag + 6'.
When I hav twain-stated flags, I name them so, but with no "is"--but I often
hav flags that hav more states.
: Stated differently, since int's are numeric values, why should one
: numeric value (0) be priviledged?
Well, yes, there are other "halving"s of the integers: besides that which C
has, in the Lisp-tradition, one can hav odd/even as the VMS-DCL has it, or,
my favorit, negativ or not negativ.
: For me, at least, `ptr' is an object (with a set of values and a set of
: legal operations, thus with a specific type). An object is, in fact, a
: noun. Grammatically, a noun can only be used with a verb, .....
I guess that that makes this bad English:
Look at me, a poor countrie boy!
or this:
The longer my vacation, the better I like the offer.
And besides this, ellipsis is quite common in speech--why not in programming?
Technical Details
Message-ID:
<3vttff$kl3@caip.rutgers.edu>Path:
arc1-ca.pugleaf.net!caip.rutgers.edu!not-for-mailReferences:
<KANZE.95Jul19114530@slsvhdt.lts.sel.alcatel.de> <3vq4uf$2lh@gabi.gabi-soft.fr>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!caip.rutgers.edu!not-for-mail From: halasz@caip.rutgers.edu Newsgroups: comp.std.c Subject: Re: Incrementing a bool Date: 4 Aug 1995 15:46:55 -0400 Organization: Rutgers University Distribution: world Message-ID: <3vttff$kl3@caip.rutgers.edu> References: <KANZE.95Jul19114530@slsvhdt.lts.sel.alcatel.de> <3vq4uf$2lh@gabi.gabi-soft.fr> NNTP-Posting-Host: caip.rutgers.edu