Xref: utzoo comp.lang.c++:4784 comp.lang.c:22235
Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!wuarchive!gem.mps.ohio-state.edu!ginosko!uunet!mcsun!ukc!mucs!liv-cs!ian
From: ian@mva.cs.liv.ac.uk
Newsgroups: comp.lang.c++,comp.lang.c
Subject: Re: Time to standardize "true" and "false"
Message-ID: <1885@mva.cs.liv.ac.uk>
Date: 23 Sep 89 17:58:43 GMT
References: <13730@well.UUCP> <1989Sep22.073138.19684@lth.se>
Organization: Computer Science CSMVAX, Liverpool University
Lines: 32

In article <1989Sep22.073138.19684@lth.se>, newsuser@lth.se (LTH network news server) writes:
> I completely agree that a boolean data type is needed in C++.  I
> think the definition should define the following properties:
> 
> 	1.  The data type is called "boolean".
>
That's just what _you_ want to call it! Why not call it `bool' or
`logical' or even `int'?

> 	2.  The allowed values are "false" and "true".
>
Why not call them `f' and `t' or `F' and `T' or even `0' and `1'?

> 	3.  int(false) = 0 and int(true) = 1
>
Well, int (0) = 0 and int (1) = 1.

> 	4.  boolean(0) = false, other values are true
>
Wouldn't it be great for conditionals in C to be false if they are testing
integer 0 and to be true if they are testing any other integer? That way
we could use integers instead of a new boolean type. Oh, looks like they
already do that!

Why do we need to introduce a new data type to do the job of a data type
we already have, but in a more complex way?

Ian Finch              Janet: ian@uk.ac.liv.cs.mva
---------              Internet: ian%mva.cs.liv.ac.uk@cunyvm.cuny.edu
                       UUCP: ...mcvax!ukc!ian@uk.ac.liv.cs.mva
===============================================================================
What's a word processor? Well, you know what a food processor does to food ...