Changeset 9959 for docs/Perl6/FAQ

Show
Ignore:
Timestamp:
04/15/06 17:08:02 (3 years ago)
Author:
audreyt
Message:

* Capture.pod - more typo fixes

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • docs/Perl6/FAQ/Capture.pod

    r9958 r9959  
    3636Here's how Captures look like deferred argument lists: 
    3737 
    38   sub make_car (Str $model, Str $color? = "black", Int $doors = 4); 
    39   my $car_cap = \("Model T", doors => 2); # some positional, some named 
     38  sub make_car ( 
     39    Str $model, 
     40    Str $color = "black", 
     41    Int $doors = 4 
     42  ) { ... } 
     43 
     44  # some positional, some named 
     45  my $car_cap = \("Model T", doors => 2); 
    4046 
    4147  # passing the opaque Capture as actual function arguments   
     
    9197=head2 What about multimethod dispatch and cases where there is more than one invocant? 
    9298 
    93 There's always one invocant, but it may be an Array of several values (see below). 
     99In the argument list (Capture), there is always zero or one invocant I<argument>. 
     100 
     101Multimethod dispatch governs cases where multiple invocant I<parameters> are 
     102declared in the parameter list (Signature); each of them may bind to the invocant 
     103argument, or one of the positional arguments. 
    94104 
    95105=head2 What happens when a named argument is repeated? 
     
    113123 
    114124The prefix C<*> method casts an object into a Capture object, and merges it 
    115 into the Capture being currently constructed (e.g. an argument list): 
     125into the Capture currently being constructed (e.g. an argument list): 
    116126 
    117127    my $cap = \(1, 2, x=>42); 
     
    162172  @y[][][]; 
    163173 
    164 =head2 Does this mean I can't have something akin to a refrence to a reference? 
     174=head2 Does this mean I can't have something akin to a reference to a reference? 
    165175 
    166176You can, as a Capture can contain another capture object in its invocant slot: 
     
    232242    @y.elems; # 1 
    233243 
    234 The behaviours below are similar to Perl 5 as well: 
     244The cases below are similar to Perl 5 as well: 
    235245 
    236246    $x.push(0);     # works - $x.elems becomes 4