Ticket #1104: Number.Float.diff

File Number.Float.diff, 1.4 KB (added by jkeenan, 12 years ago)
  • docs/book/pir/ch04_variables.pod

     
    10301030X<PMCs (Polymorphic Containers);scalar> 
    10311031In most of the examples shown so far, PMCs duplicate the behavior of integers, 
    10321032numbers, and strings. Parrot provides a set of PMCs for this exact purpose. 
    1033 C<Integer>, C<Number>, and C<String> are thin overlays on Parrot's low-level 
     1033C<Integer>, C<Float>, and C<String> are thin overlays on Parrot's low-level 
    10341034integers, numbers, and strings. 
    10351035 
    10361036A previous example showed a string literal assigned to a PMC variable of type 
     
    10451045  $P1 = new 'String' 
    10461046  $P1 = "5 birds" 
    10471047 
    1048   $P2 = new 'Number' 
     1048  $P2 = new 'Float' 
    10491049  $P2 = 3.14 
    10501050 
    10511051=end PIR_FRAGMENT 
     
    10681068  $P1 = $S1 
    10691069 
    10701070  $N2 = 3.14 
    1071   $P2 = new 'Number' 
     1071  $P2 = new 'Float' 
    10721072  $P2 = $N2 
    10731073 
    10741074=end PIR_FRAGMENT 
     
    10821082 
    10831083  $P1 = box $S1  # $P1 is a "String" 
    10841084 
    1085   $P2 = box 3.14 # $P2 is a "Number" 
     1085  $P2 = box 3.14 # $P2 is a "Float" 
    10861086 
    10871087=end PIR_FRAGMENT 
    10881088 
     
    11101110 
    11111111=end PIR_FRAGMENT 
    11121112 
    1113 This example creates C<Integer>X<Integer PMC>, C<Number>X<Number PMC>, 
     1113This example creates C<Integer>X<Integer PMC>, C<Float>X<Float PMC>, 
    11141114and C<String>X<String PMC> PMCs, and shows the effect of assigning each 
    11151115one back to a low-level type. 
    11161116