Gmail Calendar Documents Reader Web more »
Recently Visited Groups | Help | Sign in
Google Groups Home
r27399 - docs/Perl6/Spec
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  1 message - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
pugs-comm...@feather.perl6.nl  
View profile  
 More options Jul 3 2009, 11:34 pm
Newsgroups: perl.perl6.language
From: pugs-comm...@feather.perl6.nl
Date: Sat, 4 Jul 2009 05:34:16 +0200
Local: Fri, Jul 3 2009 11:34 pm
Subject: r27399 - docs/Perl6/Spec
Author: lwall
Date: 2009-07-04 05:34:15 +0200 (Sat, 04 Jul 2009)
New Revision: 27399

Modified:
   docs/Perl6/Spec/S04-control.pod
Log:
[S04] allow certain value-producing blocks as statement prefixes

Modified: docs/Perl6/Spec/S04-control.pod
===================================================================
--- docs/Perl6/Spec/S04-control.pod     2009-07-04 02:39:55 UTC (rev 27398)
+++ docs/Perl6/Spec/S04-control.pod     2009-07-04 03:34:15 UTC (rev 27399)
@@ -12,8 +12,8 @@

     Created: 19 Aug 2004

-    Last Modified: 16 Jun 2009
-    Version: 80
+    Last Modified: 3 Jul 2009
+    Version: 81

 This document summarizes Apocalypse 4, which covers the block and
 statement syntax of Perl.
@@ -1135,6 +1135,23 @@
     my $compiletime = BEGIN { localtime };
     our $temphandle = START { maketemp() };

+As with other statement prefixes, these value-producing constructs
+may be placed in front of either a block or a statement:
+
+    my $compiletime = BEGIN localtime;
+    our $temphandle = START maketemp();
+
+This can be particularly useful to expose a lexically scoped
+declaration to the surrounding context.  Hence these declare the same
+variables with the same scope as the preceding example, but run the
+statements as a whole at the indicated time:
+
+    BEGIN my $compiletime = localtime;
+    START our $temphandle = maketemp();
+
+(Note, however, that the value of a variable calculated at compile
+time may not persist under run-time cloning of any surrounding closure.)
+
 Code that is generated at run time can still fire off C<CHECK>
 and C<INIT> blocks, though of course those blocks can't do things that
 would require travel back in time.


    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2010 Google