## Re: Lives there a boolean integer?

Subject: Re: Lives there a boolean integer?
From: Peter Kleczka <pkleczka -at- yahoo -dot- com>
To: TECHWR-L <TECHWR-L -at- lists -dot- raycomm -dot- com>
Date: Mon, 6 Mar 2000 17:24:30 -0800 (PST)

Mark

Most programming languages
allow you to evaluate an integer as a boolean
regardless of whether or not the language
has a formal boolean type. If these languages
provided a boolean type (like C++ does) then
might be important to make the distinction
between an integer *type* and boolean *type*.
However it is usually more important to know
how a value is evaluated rather than its data
type. Especially in Perl, the data type
returned is dependent on the context of
how an expression is evaluated rather than
on the types involved.

If you want to be rigorous *AND*
(pun intended) refer to the integer as
boolean, just include a footnote or
something like, "although C and Perl have
no boolean type, this text refers to the
integer value returned by their functions
as boolean values where 1 = true
and 0 = false".

Pete Kleczka
pkleczka -at- yahoo -dot- com

--- "Mark L. Levinson" <markl -at- gilian -dot- com> wrote:
> I'd like to hear from people who are familiar with
> C and with Perl. I'm documenting a number of
> functions
> that return the integer 1 to indicate success and
> the
> integer 0 to indicate failure. Because these are
> the
> only two values ever returned, I'm being encouraged
> to refer to them as boolean values, and I'm
> being told that there's no real confusion involved
> because neither C nor Perl supports a true boolean
> data type.
>
> Should I stand on the principle that an integer
> is not boolean? (I am not trying to make a
> distinction between Boolean and boolean, and
> I would be content not to cause a digression
> on that topic.)
>
> Mark L. Levinson
> markl -at- gilian -dot- com
> Herzlia, Israel

_________________________________________________________
Do You Yahoo!?

Previous by Author: another useage of stringified
Next by Author: Re: Creating a link from MS Word to an ASCII file
Previous by Thread: RE: Lives there a boolean integer?
Next by Thread: RE: Lives there a boolean integer?

What this post helpful? Share it with friends and colleagues: