On Fri, May 18, 2001 at 06:22:10AM -0700, Austin Hastings wrote:
>
> --- Damian Conway <[EMAIL PROTECTED]> wrote:
>
> > It's probably just a matter of coding what you actually mean.
> > In Perl 5 and 6 your version means "if $fh is true in *any*
> > possible way...", whereas you seem to want "if $fh is defined",
> > which is:
>
> Hmm. I can easily see this producing incomprehensible code when spread
> across large systems. To wit, those developers used to "0 means false"
Any feature is incomprehensible if one is not used to it. Pointers
in C are incomprehensible if one has never met the concept before.
As far as I understand one rationale behind the "false (in Perl 5 terms)
but true (in Perl 6 terms)" is that you can write code like this
if ($retval = func(@args)) {
# it worked ...
} else {
# it didn't ...
# but we still can dig out more information
# about the result ...
print $retval.what_went_wrong, "\n";
}
> semantics seeings a scalar that they just know has a 0 in it and
> wondering why the branch isn't doing what they know it should.
Free your mind-- detach the truth of a scalar from its '0 or "" or undef'
nature.
--
$jhi++; # http://www.iki.fi/jhi/
# There is this special biologist word we use for 'stable'.
# It is 'dead'. -- Jack Cohen