Author: wayland
Date: 2009-08-15 13:19:43 +0200 (Sat, 15 Aug 2009)
New Revision: 27999

Modified:
   docs/Perl6/Spec/S02-bits.pod
   docs/Perl6/Spec/S16-io.pod
   docs/Perl6/Spec/S32-setting-library/IO.pod
Log:
[S02,S16,S32/IO] Added special quoting that creates IO::FSNode objects.  
This could still be controversial, but I've gone with the 
"Forgiveness/Permission" thing.  If no-one fights it, I'll revise the
Draft IO specs (S16 and S32/IO) to refer to IO::FSNode objects in 
appropriate places instead of strings.  


Modified: docs/Perl6/Spec/S02-bits.pod
===================================================================
--- docs/Perl6/Spec/S02-bits.pod        2009-08-15 05:51:50 UTC (rev 27998)
+++ docs/Perl6/Spec/S02-bits.pod        2009-08-15 11:19:43 UTC (rev 27999)
@@ -2834,6 +2834,7 @@
                 :subst          Parse as substitution
                 :trans          Parse as transliteration
                 :code           Quasiquoting
+    :io                         Return an IO::FSNode
 
 You may omit the first colon by joining an initial C<Q>, C<q>, or C<qq> with
 a single short form adverb, which produces forms like:

Modified: docs/Perl6/Spec/S16-io.pod
===================================================================
--- docs/Perl6/Spec/S16-io.pod  2009-08-15 05:51:50 UTC (rev 27998)
+++ docs/Perl6/Spec/S16-io.pod  2009-08-15 11:19:43 UTC (rev 27999)
@@ -78,6 +78,21 @@
 S32-setting-library/IO.pod.  The main functions used are listed in S29 with 
references to
 S32-setting-library/IO.pod.
 
+=head2 Special Quoting Syntax
+
+The use of filenames requires a special quoting syntax.  It works as follows:
+
+    q:io{/path/to/file}
+
+The quote characters can be any of the usual ones, although / is probably a 
bad choice
+for filenames.  
+
+The code shown above returns an IO::FSNode object (or a descendant thereof).  
+
+Naturally you can also ask for interpolation in filenames:
+
+    qq:io{$directory/$file}
+
 =head1 Name Services
 
 =head2 User role

Modified: docs/Perl6/Spec/S32-setting-library/IO.pod
===================================================================
--- docs/Perl6/Spec/S32-setting-library/IO.pod  2009-08-15 05:51:50 UTC (rev 
27998)
+++ docs/Perl6/Spec/S32-setting-library/IO.pod  2009-08-15 11:19:43 UTC (rev 
27999)
@@ -587,19 +587,18 @@
         :$Readable
     );
 
-The C<FSNode>, C<Filename> and C<fd> options are mutually exclusive.  If 
"C<use portable>" is in
-effect, the C<Filename> option throws an error; use an C<FSNode> instead.
+The C<FSNode> and C<fd> options are mutually exclusive.  
 
 C<NoOpen> is passed to C<IO::Streamable.new()>
 
 Examples:
 
-    # Read -- throws errors with 'use portable'
-    $fobj = new IO::File(Filename => $filename);
+    # Read, no interpolation
+    $fobj = new IO::File(FSNode => q:io{/path/to/file});
 
-    # Write -- works with 'use portable'
+    # Write, interpolation
     $fobj = new IO::File(
-        FSNode => IO::FSNode.new(type => 'Unix', Filename => $filename),
+        FSNode => q:io:qq{$filename},
         Writeable => 1
     );
 

Reply via email to