Changeset 9976 for docs/Perl6/FAQ

Show
Ignore:
Timestamp:
04/17/06 07:28:36 (3 years ago)
Author:
gaal
Message:

r10025@sike: roo | 2006-04-17 08:27:16 +0300

  • FAQ::Capture - copyediting. TODO: make consistent the use of "fail" vs. "error", in all our docs and not just here.
Files:
1 modified

Legend:

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

    r9966 r9976  
    120120 
    121121However, regardless of single- or multi- dispatch, the argument list (Capture) 
    122 can never have more than one invocants.  Typically, the presence of an invocant 
     122can never have more than one invocant.  Typically, the presence of an invocant 
    123123indicates a method-call (which may fall back to a subroutine-call); the lack of 
    124124invocant means a subroutine-call. 
    125125 
    126     1.foo(2);  # Int.foo with 1 as "self"; if not found, fallback to foo(1, 2) 
     126    1.foo(2);  # Int.foo with 1 as "self"; if not 
     127               # found, fallback to foo(1, 2) 
    127128    foo(1: 2); # same as above 
    128129 
    129     bar(1, 2); # never looks at Int.foo; calls &foo in lexical/package scope 
     130    bar(1, 2); # never looks at Int.bar; calls &bar 
     131               # in lexical/package scope 
    130132 
    131133Method/subroutine calls are determined by the presence of an invocant at the 
     
    266268 
    267269  sub foo (@y is rw) { ... } 
    268   foo(1, 2, 3); # error: three arguments passed where one is expected 
     270  foo(1, 2, 3); # FAIL: three arguments passed where one is expected 
    269271 
    270272However, these forms are valid: 
     
    282284modify the container itself, so this won't work: 
    283285 
    284   @y.push(4);   # error: cannot find method: List.push 
     286  @y.push(4);   # FAIL: cannot find method: List.push 
    285287 
    286288On the other hand, because variables are initialized by their sigils, 
     
    300302Array container bound to C<@y>: 
    301303 
    302     $x.push(0); # error: cannot find method: List.push 
     304    $x.push(0); # FAIL: cannot find method: List.push 
    303305    @y.push(0); # works just fine 
    304306 
     
    327329However, they differ when you try to assign something into them: 
    328330 
    329     $x = 42; # fails - Array doesn't handle scalar assignment 
     331    $x = 42; # FAIL - Array doesn't handle scalar assignment 
    330332    @y = 42; # works - @y.elems is now 1 
    331333 
     
    340342 
    341343    $x := 41; 
    342     $x = 42;        # fails - Int doesn't handle scalar assignment either 
     344    $x = 42;        # FAIL - Int doesn't handle scalar assignment either 
    343345 
    344346=head2 Why