Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw

Re^4: Perl oddities

by TimToady (Parson)
on Mar 01, 2005 at 19:02 UTC ( #435576=note: print w/replies, xml ) Need Help??

in reply to Re^3: Perl oddities
in thread Perl oddities

We will try to nail those down a little better in Perl 6. Returning the null string for false was a premature optimization on my part, and a false economy (as it were), so the standard boolean operators will return 0 and 1 in Perl 6 so that when you print them out, they look like something rather than nothing. Also, since Perl 6 distinguishes boolean from numeric and string contexts, it can optimize away the actual production of a 0 or 1 value in many cases.

That's not to say that we're ever going to require people to use 0 and 1 for boolean values. Perl 6 will be just like Perl 5 in letting you treat just about anything as a boolean value. So non-zero numbers are still true, as are strings that aren't null or "0". And maybe we can fix the "0" problem too.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://435576]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (6)
As of 2016-10-22 04:33 GMT
Find Nodes?
    Voting Booth?
    How many different varieties (color, size, etc) of socks do you have in your sock drawer?

    Results (292 votes). Check out past polls.