TechWhirl (TECHWR-L) is a resource for technical writing and technical communications professionals of all experience levels and in all industries to share their experiences and acquire information.
For two decades, technical communicators have turned to TechWhirl to ask and answer questions about the always-changing world of technical communications, such as tools, skills, career paths, methodologies, and emerging industries. The TechWhirl Archives and magazine, created for, by and about technical writers, offer a wealth of knowledge to everyone with an interest in any aspect of technical communications.
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!?
Get your free @yahoo.com address at http://mail.yahoo.com