From: fjh@munta.cs.mu.OZ.AU (Fergus James HENDERSON)
Subject: Re: New C++ type: boole
Organization: Computer Science, University of Melbourne, Australia
Date: Mon, 27 Jul 1992 02:44:43 GMT

Firstly I think I should appologize for the tone of my previous article,
which came out much more like a flame than I intended it to.
I guess I wasn't really being very constructive. Sorry.

dougm@titan.cs.rice.edu (Doug Moore) writes:

>>>>>> On Sun, 26 Jul 1992 17:59:44 GMT, fjh@munta.cs.mu.OZ.AU (Fergus James HENDERSON) said:
>
>	Dougm> programming idiom.  No proposed change to C++ can invalidate such
>	Dougm> expressions.        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>	Fergus>^^^^^^^^^^^^^
>	Fergus> To most of us, that point is enough to convince us
>	Fergus> that any attempt to add a boolean type to C++ is not
>	Fergus> going to buy us enough that it is worth the effort
>	Fergus> required to implement it.
>
>So you don't want a boolean type.  Fine.  That is a matter of taste
>and programming style, not a technical criticism.  To make one of
>those, you have to argue that the proposed changes *will* "invalidate
>such expressions".

In fact I would *like* a real boolean type.
The problem is that to do it properly, you shouldn't allow any implicit
conversions between int and boole, or between pointers and boole.
Unfortunately due to the ever-present requirement of backwards-compatability,
exactly those conversions must be allowed.
Due to this contradiction, I do think that the proposal is fundamentally
flawed.
[Does that qualify as "technical criticism"?]

If and when we all move to "D", then I think that "D" should have a proper
boolean type. Sadly we're stuck with C++ :-).

>Programmers in Fortran have no conceptual
>problem with .TRUE.  and programmers in Scheme have no trouble with
>#t.  C++ programmers are just as capable of understanding 0t.

.TRUE. is fine, #t is getting a little obtuse, and 0t is worse than #t.
0t makes it look like some sort of variation on zero, which it is definately
not.

>There are several reactions to my proposal that I can respect.  They
>are:
>
>1.  I don't like it, because I like to mix types as I now can in C.
>2.  I don't like it, because it is fundamentally flawed.
>3.  I don't like it, becuase <some aesthetic issue about 0t or somesuch>.
>4.  It is flawed, but fixable; here's how.
>5.  Such insight!  We'll get it in our compiler right away!
>
>You claim to belong in category 2.  You belong in category 1.  I sense
>that the substantial improvements you would have me make would be in
>the nature of shortening the proposal.  Possibly to a single blank
>character.

Shorter -- yes. Empty -- no.
[I think that just adding a standard header file "boolean.h" with
	enum { FALSE, TRUE; }
	typedef int boolean;
would be enough.]

>I can accept that some people don't want change, or don't want a
>boolean type in particular.  If you hold that opinion, express it and
>I won't argue with you.  But don't state that a proposal is full of
>holes (i.e. ambiguities, self-contradictions, contradictions with the
>current standard, etc.) unless you are willing to present them.
>
>*Constructive* feedback is still welcome.

Well, I am afraid that I am being 'non-constructive' again. :-(

I am not saying that your proposal would be entirely without benefit.
Rather, I think that the cost/benefit ratio is too high.
As has been noted before on this forum, there are many other *good* proposals.
There *is* a limit to how many can be accepted into the standard and how
much work we can expect compiler writers to do.
C++ is already too complex. Your proposal would add just a little bit more
complexity too the language. For some, it could be the straw that breaks
the camel's back.

As long as there are other, more important proposals still on the agenda
then we should worry about them first.

	Fergus.

-- 
Fergus Henderson             fjh@munta.cs.mu.OZ.AU      
This .signature VIRUS is a self-referential statement that is true - but 
you will only be able to consistently believe it if you copy it to your own
.signature file!
Newsgroups: comp.lang.c++