Changeset 23723

Show
Ignore:
Timestamp:
02/03/07 18:32:03 (2 years ago)
Author:
larry
Message:

s:g/TEST/STATUS/ at suggestion of Smylers++.

Location:
doc/trunk/design/syn
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • doc/trunk/design/syn/S03.pod

    r23722 r23723  
    1313  Maintainer: Larry Wall <larry@wall.org> 
    1414  Date: 8 Mar 2004 
    15   Last Modified: 2 Feb 2007 
     15  Last Modified: 3 Feb 2007 
    1616  Number: 3 
    17   Version: 96 
     17  Version: 97 
    1818 
    1919=head1 Overview 
     
    14171417Both of these forms actually translate to 
    14181418 
    1419     if $filename.TEST(:e) { say "exists" } 
     1419    if $filename.STATUS(:e) { say "exists" } 
    14201420 
    14211421which is a generic mechanism that dispatches to the object's 
    1422 class to find the definition of C<TEST>.  (It just happens that C<Str> 
     1422class to find the definition of C<STATUS>.  (It just happens that C<Str> 
    14231423(filenames) and C<IO> (filehandles) default to the expected filetest 
    14241424semantics, but C<$regex.:i> might tell you whether the regex is case 
     
    21542154    Any       Str       string equality         ~$_ eq X 
    21552155 
    2156     Any       Pair      test object             .TEST(X) (Str,IO do filetest) 
     2156    Any       Pair      test object             .STATUS(X) (Str,IO do filetest) 
    21572157 
    21582158    Set       Set       identical sets          $_ === X 
  • doc/trunk/design/syn/S12.pod

    r23720 r23723  
    1313  Maintainer: Larry Wall <larry@wall.org> 
    1414  Date: 27 Oct 2004 
    15   Last Modified: 2 Feb 2007 
     15  Last Modified: 3 Feb 2007 
    1616  Number: 12 
    17   Version: 37 
     17  Version: 38 
    1818 
    1919=head1 Overview 
     
    618618it actually calls 
    619619 
    620     $filehandle.TEST(:e) 
    621     $filehandle.TEST(:!x) 
     620    $filehandle.STATUS(:e) 
     621    $filehandle.STATUS(:!x) 
    622622 
    623623which is expected to return a value that can be used as a boolean. 
    624624While this is primarily intended for use by file tests, other classes 
    625 may define a C<TEST> method to provide a similar mechanism for interrogating 
     625may define a C<STATUS> method to provide a similar mechanism for interrogating 
    626626lightweight properties without having to define methods for all of them. 
    627627 
    628628Note, though, that I<all> such queries are answered by the first located 
    629 C<TEST> method--they are not inherited independently.  The C<TEST> method 
     629C<STATUS> method--they are not inherited independently.  The C<STATUS> method 
    630630must explicitly pass the query on to other classes in such cases.  Likewise, 
    631 if conflicting C<TEST> methods are composed from two different roles, they 
     631if conflicting C<STATUS> methods are composed from two different roles, they 
    632632must be disambiguated as any other conflicting method would be. 
    633633