Ticket #1116: ch05_page47.patch

File ch05_page47.patch, 1.3 KB (added by jkeenan, 12 years ago)

Page 47 Conditionals and Unconditionals section

  • docs/book/pir/ch05_control_structures.pod

     
    1717X<unconditional branch> 
    1818An unconditional branch always jumps to a specified label.  PIR has only 
    1919one unconditional branch instruction, C<goto>. In this example, the 
    20 first C<print> statement never runs because the C<goto> always skips 
     20first C<say> statement never runs because the C<goto> always skips 
    2121over it to the label C<skip_all_that>: 
    2222 
    2323=begin PIR_FRAGMENT 
  • docs/book/pir/ch04_variables.pod

     
    160160X<logical opcodes> 
    161161The logical opcodes evaluate the truth of their arguments.  They are most 
    162162useful to make decisions for control flow.  Integers and numeric PMCs 
    163 support logical are false if they're 0 and true otherwise. Strings are 
     163are false if they're 0 and true otherwise. Strings are 
    164164false if they're the empty string or a single character "0", and true 
    165165otherwise. PMCs are true when their C<get_bool>X<get_bool vtable 
    166166function> vtable function returns a nonzero value.