Author: audreyt
Date: Wed Nov 1 07:51:52 2006
New Revision: 13366
Modified:
doc/trunk/design/syn/S01.pod
doc/trunk/design/syn/S11.pod
Log:
* S01 and S11: Per fglock++'s suggestion, add the "use v5;"
compatibility form, which can occur only at the beginning
of a lexical block:
use v6-alpha;
# ...some Perl 6 code...
{
use v5;
# ...some Perl 5 code...
{
use v6-alpha;
# ...more Perl 6 code...
}
}
Modified: doc/trunk/design/syn/S01.pod
==============================================================================
--- doc/trunk/design/syn/S01.pod (original)
+++ doc/trunk/design/syn/S01.pod Wed Nov 1 07:51:52 2006
@@ -12,9 +12,9 @@
Maintainer: Larry Wall <[EMAIL PROTECTED]>
Date: 10 Aug 2004
- Last Modified: 14 Sept 2006
+ Last Modified: 1 Nob 2006
Number: 1
- Version: 4
+ Version: 5
This document originally summarized Apocalypse 1, which covers the
initial design concept. That original summary may be found below
@@ -113,6 +113,23 @@
=item *
+Migration in the other direction is also important. In Perl 6
+mode, one can drop back to Perl 5 mode with C<use v5> at the
+beginning of a lexical block. Such blocks may be nested:
+
+ use v6-alpha;
+ # ...some Perl 6 code...
+ {
+ use v5;
+ # ...some Perl 5 code...
+ {
+ use v6-alpha;
+ # ...more Perl 6 code...
+ }
+ }
+
+=item *
+
Scaling is one of those areas where Perl needs to be multiparadigmatic
and context sensitive. Perl 5 code is not strict by default, while
Perl 6 code is. But it should be easy to relax with C<-e> or
Modified: doc/trunk/design/syn/S11.pod
==============================================================================
--- doc/trunk/design/syn/S11.pod (original)
+++ doc/trunk/design/syn/S11.pod Wed Nov 1 07:51:52 2006
@@ -12,9 +12,9 @@
Maintainer: Larry Wall <[EMAIL PROTECTED]>
Date: 27 Oct 2004
- Last Modified: 6 Jul 2006
+ Last Modified: 1 Nov 2006
Number: 11
- Version: 14
+ Version: 15
=head1 Overview
@@ -341,6 +341,21 @@
a bare literal in a void context I<ought> to have produced a warning.
(Invoking perl with C<-e6> has the same effect.)
+In the other direction, to inline Perl 5 code inside a Perl 6 program, put
+C<use v5> at the beginning of a lexical block. Such blocks can nest
arbitrarily
+deeply to switch between Perl versions:
+
+ use v6-alpha;
+ # ...some Perl 6 code...
+ {
+ use v5;
+ # ...some Perl 5 code...
+ {
+ use v6-alpha;
+ # ...more Perl 6 code...
+ }
+ }
+
It's not necessary to force Perl 6 if the interpreter or command
specified already implies it, such as use of a "C<#!/usr/bin/perl6>"
shebang line. Nor is it necessary to force Perl 6 in any file that