[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [MacPerl] find value in array



At 5:30 PM -0400 10/18/2000, Ronald J Kimball wrote:
>On Wed, Oct 18, 2000 at 01:38:12PM -0700, Linc Madison wrote:
>>  At 8:33 PM +0200 10/18/2000, Bart Lateur wrote:
>>  >OTOH, it's not the only string for which this is the case: other zero
>>  >valued strings are True as well: "0E0", "0.000", ".0", "0.", "-0". All
>>  >zero, all true. So this exception was actualy unnecessary.
>>
>>  Actually, the exception WAS necessary.
>
>He means, the exception was not necessary because Perl's built-in 
>functions could have returned '0E0' instead of '0 but true'.  Both 
>convert to 0, both are true in a boolean context, but '0E0' is 
>numeric and '0 but true' isn't.
>
>If Perl's built-ins had been written to return '0E0' instead, then 
>there would not have been an exception for '0 but true'.

Ah, okay. Ambiguities of English; I misinterpreted the statement.

Certain functions could have been written to return "0.0" (or 
whatever) instead of "0 but true", thereby making the special case 
unnecessary. However, since they were written to return "0 but true", 
the special case is necessary.

-- 
Linc Madison  *  San Francisco, CA  *  LincPerl@LincMad.com
NO SPAM: California Bus & Prof Code Section 17538.45 applies!

# ===== Want to unsubscribe from this list?
# ===== Send mail with body "unsubscribe" to macperl-request@macperl.org