1 # Copyright (C) 2007-2009, Parrot Foundation.
6 Both the if and unless conditionals are supported in PIR. When the
7 tested condition matches the sense of the conditional (true for if,
8 false for unless), then the following C<goto> statement is executed.
10 Truth is fairly simple to determine, depending on the data type being
17 0 is false, any other number is true.
21 The empty string is false, all other strings are true.
25 0.0 is false, whether it is positive or negative. All other numbers
26 are true, including NaN. NaN is the value you get if you try to divide
27 by zero, or do other illegal operations.
31 The "truthiness" of a PMC depends on how it implements its vtable
32 method C<get_boolean>. This changes for each different type of PMC,
33 but is usually straight-forward.
44 if $I0 goto branch_to_here
52 unless $I0 goto dont_branch_to_here
74 # vim: expandtab shiftwidth=4 ft=pir: