[svn:perl6-synopsis] r13569 - doc/trunk/design/syn

2007-02-03 Thread larry
Author: larry
Date: Sat Feb  3 09:32:03 2007
New Revision: 13569

Modified:
   doc/trunk/design/syn/S03.pod
   doc/trunk/design/syn/S12.pod

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


Modified: doc/trunk/design/syn/S03.pod
==
--- doc/trunk/design/syn/S03.pod(original)
+++ doc/trunk/design/syn/S03.podSat Feb  3 09:32:03 2007
@@ -12,9 +12,9 @@
 
   Maintainer: Larry Wall <[EMAIL PROTECTED]>
   Date: 8 Mar 2004
-  Last Modified: 2 Feb 2007
+  Last Modified: 3 Feb 2007
   Number: 3
-  Version: 96
+  Version: 97
 
 =head1 Overview
 
@@ -1416,10 +1416,10 @@
 
 Both of these forms actually translate to
 
-if $filename.TEST(:e) { say "exists" }
+if $filename.STATUS(:e) { say "exists" }
 
 which is a generic mechanism that dispatches to the object's
-class to find the definition of C.  (It just happens that C
+class to find the definition of C.  (It just happens that C
 (filenames) and C (filehandles) default to the expected filetest
 semantics, but C<$regex.:i> might tell you whether the regex is case
 insensitive, for instance.)
@@ -2153,7 +2153,7 @@
 Any   Num   numeric equality+$_ == X
 Any   Str   string equality ~$_ eq X
 
-Any   Pair  test object .TEST(X) (Str,IO do filetest)
+Any   Pair  test object .STATUS(X) (Str,IO do filetest)
 
 Set   Set   identical sets  $_ === X
 Hash  Set   hash keys same set  $_.keys === X

Modified: doc/trunk/design/syn/S12.pod
==
--- doc/trunk/design/syn/S12.pod(original)
+++ doc/trunk/design/syn/S12.podSat Feb  3 09:32:03 2007
@@ -12,9 +12,9 @@
 
   Maintainer: Larry Wall <[EMAIL PROTECTED]>
   Date: 27 Oct 2004
-  Last Modified: 2 Feb 2007
+  Last Modified: 3 Feb 2007
   Number: 12
-  Version: 37
+  Version: 38
 
 =head1 Overview
 
@@ -617,18 +617,18 @@
 
 it actually calls
 
-$filehandle.TEST(:e)
-$filehandle.TEST(:!x)
+$filehandle.STATUS(:e)
+$filehandle.STATUS(:!x)
 
 which is expected to return a value that can be used as a boolean.
 While this is primarily intended for use by file tests, other classes
-may define a C method to provide a similar mechanism for interrogating
+may define a C method to provide a similar mechanism for interrogating
 lightweight properties without having to define methods for all of them.
 
 Note, though, that I such queries are answered by the first located
-C method--they are not inherited independently.  The C method
+C method--they are not inherited independently.  The C method
 must explicitly pass the query on to other classes in such cases.  Likewise,
-if conflicting C methods are composed from two different roles, they
+if conflicting C methods are composed from two different roles, they
 must be disambiguated as any other conflicting method would be.
 
 Depending on the class, the pairs in question may have arguments.


Re: [svn:perl6-synopsis] r13567 - doc/trunk/design/syn

2007-02-03 Thread Dr.Ruud
Larry Wall schreef:
> Dr.Ruud wrote:

>> I would expect
>>
>>   %hash.exists{$key}
>
> Except $foo.bar{$key} is interpreted as $foo.bar().{$key}.  Things
> like "exists" and "delete" need to evaluate the key before calling
> the method in question, not after.

OK.

>> with the shortcut
>>
>>   %hash.:{$key}
>>
>> to test (at run-time) for existance of the element, and expect
>>
>>   %hash.:exists
>>
>> to test (at compile time if possible) for the validity of 'exists',
>> more like
>>
>>   %hash.can('exists');
>>
>>   %hash.has('exists');
>>
>>   %hash.does('exists');
>
> Why would you expect colon to do that?  I don't see the prior art...

I was reading : as TEST (or indeed STATUS, or even STATE), and read the
part ":exists" a "the STATUS (or validity) of exists()", which would
always be true (or >0) because exists() is in the "hash-core".

So "%table.:$key" or "%table.:{$key}" would then be short for
"%table.exists{key}" (assuming exists() to be the default
TEST/STATUS/STATE-method for hash).

-- 
Affijn, Ruud

"Gewoon is een tijger."