Changeset 23723
- Timestamp:
- 02/03/07 18:32:03 (2 years ago)
- Location:
- doc/trunk/design/syn
- Files:
-
- 2 modified
Legend:
- Unmodified
- Added
- Removed
-
doc/trunk/design/syn/S03.pod
r23722 r23723 13 13 Maintainer: Larry Wall <larry@wall.org> 14 14 Date: 8 Mar 2004 15 Last Modified: 2Feb 200715 Last Modified: 3 Feb 2007 16 16 Number: 3 17 Version: 9 617 Version: 97 18 18 19 19 =head1 Overview … … 1417 1417 Both of these forms actually translate to 1418 1418 1419 if $filename. TEST(:e) { say "exists" }1419 if $filename.STATUS(:e) { say "exists" } 1420 1420 1421 1421 which 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>1422 class to find the definition of C<STATUS>. (It just happens that C<Str> 1423 1423 (filenames) and C<IO> (filehandles) default to the expected filetest 1424 1424 semantics, but C<$regex.:i> might tell you whether the regex is case … … 2154 2154 Any Str string equality ~$_ eq X 2155 2155 2156 Any Pair test object . TEST(X) (Str,IO do filetest)2156 Any Pair test object .STATUS(X) (Str,IO do filetest) 2157 2157 2158 2158 Set Set identical sets $_ === X -
doc/trunk/design/syn/S12.pod
r23720 r23723 13 13 Maintainer: Larry Wall <larry@wall.org> 14 14 Date: 27 Oct 2004 15 Last Modified: 2Feb 200715 Last Modified: 3 Feb 2007 16 16 Number: 12 17 Version: 3 717 Version: 38 18 18 19 19 =head1 Overview … … 618 618 it actually calls 619 619 620 $filehandle. TEST(:e)621 $filehandle. TEST(:!x)620 $filehandle.STATUS(:e) 621 $filehandle.STATUS(:!x) 622 622 623 623 which is expected to return a value that can be used as a boolean. 624 624 While this is primarily intended for use by file tests, other classes 625 may define a C< TEST> method to provide a similar mechanism for interrogating625 may define a C<STATUS> method to provide a similar mechanism for interrogating 626 626 lightweight properties without having to define methods for all of them. 627 627 628 628 Note, though, that I<all> such queries are answered by the first located 629 C< TEST> method--they are not inherited independently. The C<TEST> method629 C<STATUS> method--they are not inherited independently. The C<STATUS> method 630 630 must explicitly pass the query on to other classes in such cases. Likewise, 631 if conflicting C< TEST> methods are composed from two different roles, they631 if conflicting C<STATUS> methods are composed from two different roles, they 632 632 must be disambiguated as any other conflicting method would be. 633 633
