Topic: Alternative to "bool*" (was: From C++ to Shining C (bool))
Author: pardoej@lonnds.ml.com (Julian Pardoe LADS LDN X1428)
Date: 1995/08/07 Raw View
In article <6495210.84230.22474@kcbbs.gen.nz>, martin@kcbbs.gen.nz (Martin Kealey) writes
--> BTW: Has anyone considered that under and specification-based extended integer
--> range (such as proposed by Frank Farance), it is possible simply to say
-->
--> typedef int fast exact:1 logical_t;
..but conceptually a Boolean is not the same as an integer in the range 0..1!
...plus I'm a bit worried how these new ways of specifying integers would interact
with overloading. The set of integer types becomes quite large.
(Perhaps a built-in way of doing the equivalent of Ada's "T: type := new INTEGER"
(or however it goes) with T becoming overloadable-on would help. I've often
felt the need to say (e.g.) "a priority is an integer (but it's not compatible
with a time-interval -- even though that's also an integer". Of course, one can
do this already in C++, even if it's a bit tedious.)
-- jP --
Author: martin@kcbbs.gen.nz (Martin Kealey)
Date: 1995/07/30 Raw View
J Scott Peter (scotty@netcom.com) wrote:
> I don't like `boolean', because why should so utterly simple a concept be
> named after some man who allegedly `discovered' it?
One of the common mis-conceptions surrounding the name is that Boolean
algebra implies a 2-value system, when it does not. Check out any text on
formal logic if you doubt this.
What the mathematician did was formalise a system of set algebra that formed
a field, which as it happens contains the standard logical operations when
the set upon which the field is based is Z2 (set of non-negative integers
modulo 2).
Author: halasz@caip.rutgers.edu
Date: 1995/07/31 Raw View
In article <6495210.84230.22474@kcbbs.gen.nz>, martin@kcbbs.gen.nz (Martin Kealey) writes
+ BTW: Has anyone considered that under and specification-based extended integer
+ range (such as proposed by Frank Farance), it is possible simply to say
+
+ typedef int fast exact:1 logical_t;
This indeed expozes the queerness of both propozals--but beware of "++":
this makes it flip the state, not make it "1".
Author: scotty@netcom.com (J Scott Peter)
Date: 1995/07/29 Raw View
Paul Long (plong@perf.com) says:
> mike@if.com (Mr.H) wrote:
> >What about this: call the boolean type something other than
> >'bool' or 'boolean'.
> Some language, possibly PL/I, called these things "logicals," as in
> logical p;
> How about "logical?"
What you're talking about is a binary variable: a variable that can take one
of two values. That is the best name for the type: `binary'. I don't like
`boolean', because why should so utterly simple a concept be named after
some man who allegedly `discovered' it? I also don't like `logical',
because that term seems to have very little to do with the nature of the
type. How is a binary variable any more (or less) logical than another
variable?
--
J Scott Peter XXXIII // Wrong thinking is punishable.
scotty@netcom.com // Right thinking is as quickly rewarded.
Los Angeles // You will find it an effective combination.
Author: Paul Long <plong@perf.com>
Date: 1995/07/21 Raw View
mike@if.com (Mr.H) wrote:
>What about this: call the boolean type something other than
>'bool' or 'boolean'.
Some language, possibly PL/I, called these things "logicals," as in
logical p;
How about "logical?"
--
Paul Long 45:29:14N 122:48:09W
plong@perf.com http://www.teleport.com/~pciwww/
"Wagging head and tail, the red-tailed fish, unsupported, turns around."