Re: Storing object references in hashes
- From: "A. Sinan Unur" <1usa@xxxxxxxxxxxxxxxxxxx>
- Date: Tue, 31 Jan 2006 14:08:41 GMT
"Paul Lalli" <mritty@xxxxxxxxx> wrote in
news:1138715672.390211.173060@xxxxxxxxxxxxxxxxxxxxxxxxxxxx:
> Bryan Balfour wrote:
....
>> TRUE/FALSE v's 1/0. Using TRUE/FALSE means more to me than 1/0 so,
>> until it's demonstarted to me that it's poor programming, I'll
>> continue. I've used this technique for years, together with ON/OFF
>> etc, and I'm too old to change now without a good reason.
>
> My only issue with it is that it requires more typing (both by way of
> typing TRUE instead of 1, and the declarations of the constants in
> every package), for seemingly little benefit.
"False" in Perl is not just zero. In particular, the empty string and
empty list are among the possible false values that can be returned.
"True" is not just 1, "0.0" is true as well.
While one may find it easy construct the correct returns/comparisons in
one's own code Perl itself, and modules do use the full range of values.
#define TRUE 1
#define FALSE 0
was never a good idea in C or C++, and it is not in Perl.
Sinan
--
A. Sinan Unur <1usa@xxxxxxxxxxxxxxxxxxx>
(reverse each component and remove .invalid for email address)
comp.lang.perl.misc guidelines on the WWW:
http://mail.augustmail.com/~tadmc/clpmisc/clpmisc_guidelines.html
.
- References:
- Storing object references in hashes
- From: Bryan Balfour
- Re: Storing object references in hashes
- From: Paul Lalli
- Re: Storing object references in hashes
- From: Bryan Balfour
- Re: Storing object references in hashes
- From: Paul Lalli
- Storing object references in hashes
- Prev by Date: Re: Substitutions in matched patterns?
- Next by Date: Re: why doesn't sort properly?
- Previous by thread: Re: Storing object references in hashes
- Next by thread: Re: Storing object references in hashes
- Index(es):
Relevant Pages
|