r28528 - in docs/Perl6/Spec: . S32-setting-library

2009-10-01 Thread pugs-commits
Author: lwall
Date: 2009-10-01 18:53:43 +0200 (Thu, 01 Oct 2009)
New Revision: 28528

Modified:
   docs/Perl6/Spec/S04-control.pod
   docs/Perl6/Spec/S32-setting-library/Basics.pod
   docs/Perl6/Spec/S32-setting-library/IO.pod
Log:
[S04] add statement_prefix:quietly
[IO] add note function as say to stderr
[Basics] clarify semantics of warning exceptions


Modified: docs/Perl6/Spec/S04-control.pod
===
--- docs/Perl6/Spec/S04-control.pod 2009-10-01 11:49:58 UTC (rev 28527)
+++ docs/Perl6/Spec/S04-control.pod 2009-10-01 16:53:43 UTC (rev 28528)
@@ -13,8 +13,8 @@
 
 Created: 19 Aug 2004
 
-Last Modified: 4 Sep 2009
-Version: 82
+Last Modified: 1 Oct 2009
+Version: 83
 
 This document summarizes Apocalypse 4, which covers the block and
 statement syntax of Perl.
@@ -720,7 +720,7 @@
 Xdo
 
 Other similar forms, where a keyword is followed by code to be controlled by 
it, may also take bare statements,
-including Ctry, Ccontend, Casync, Clazy, and Cvoid.  These constructs
+including Ctry, Cquietly, Ccontend, Casync, Clazy, and Cvoid.  
These constructs
 establish a dynamic scope without necessarily establishing a lexical
 scope.  (You can always establish a lexical scope explicitly by using
 the block form of argument.)  As statement introducers, all these
@@ -870,7 +870,7 @@
 
 The Perl 6 equivalent to Perl 5's Ceval {...} is Ctry {...}.
 (Perl 6's Ceval function only evaluates strings, not blocks.)
-A Ctry block by default has a CCATCH block that handles all
+A Ctry block by default has a CCATCH block that handles all fatal
 exceptions by ignoring them.  If you define a CCATCH block within
 the Ctry, it replaces the default CCATCH.  It also makes the Ctry
 keyword redundant, because any block can function as a Ctry block

Modified: docs/Perl6/Spec/S32-setting-library/Basics.pod
===
--- docs/Perl6/Spec/S32-setting-library/Basics.pod  2009-10-01 11:49:58 UTC 
(rev 28527)
+++ docs/Perl6/Spec/S32-setting-library/Basics.pod  2009-10-01 16:53:43 UTC 
(rev 28528)
@@ -19,8 +19,8 @@
 
 Created: 19 Mar 2009 extracted from S29-functions.pod
 
-Last Modified: 30 Apr 2009
-Version: 2
+Last Modified: 1 Oct 2009
+Version: 3
 
 The document is a draft.
 
@@ -191,9 +191,20 @@
 
  our multi method warn ( Object $o: ) is export
 
-Prints a warning to C$*ERR, which is usually finds C$PROCESS::ERR. See
-CSynopsis 16: IPC / IO / Signals for details.
+Throws a resumable warning exception, which is considered a control
+exception, and hence is invisible to most normal exception handlers.
+The outermost control handler will print the warning to C$*ERR
+(which is usually finds C$PROCESS::ERR; see CSynopsis 16: IPC /
+IO / Signals for details).  After printing the warning, the exception
+is resumed where it was thrown.  To override this behavior, catch the
+exception in a CONTROL block.  A quietly {...} block is the opposite of a
+try {...} block in that it will suppress any warnings but pass fatal
+exceptions through.
 
+To simply print to C$*ERR, please use Cnote instead.  Cwarn
+should be reserved for use in threatening situations when you don't
+quite want to throw an exception.
+
 =back
 
 =head2 Pattern

Modified: docs/Perl6/Spec/S32-setting-library/IO.pod
===
--- docs/Perl6/Spec/S32-setting-library/IO.pod  2009-10-01 11:49:58 UTC (rev 
28527)
+++ docs/Perl6/Spec/S32-setting-library/IO.pod  2009-10-01 16:53:43 UTC (rev 
28528)
@@ -22,8 +22,8 @@
 
 Created: 19 Feb 2009 extracted from S29-functions.pod; added stuff from 
S16-IO later
 
-Last Modified: 18 Aug 2009
-Version: 7
+Last Modified: 1 Oct 2009
+Version: 8
 
 The document is a draft.
 
@@ -92,6 +92,13 @@
 
 See below for details.
 
+=item note
+Xnote
+
+multi note (*...@list -- Bool)
+
+See below for details.
+
 =item printf
 Xprintf
 
@@ -439,6 +446,10 @@
 As with Cprint, it is a compiler error to use a bare Csay without
 arguments.
 
+=item multi note (*...@list -- Bool)
+
+Does a say to C$*ERR.
+
 =item method printf ($self: Str $fmt, *...@list -- Bool)
 
 =item multi printf (Str $fmt, *...@list -- Bool)



Re: r28528 - in docs/Perl6/Spec: . S32-setting-library

2009-10-01 Thread Jon Lang
On Thu, Oct 1, 2009 at 9:53 AM,  pugs-comm...@feather.perl6.nl wrote:
  The Perl 6 equivalent to Perl 5's Ceval {...} is Ctry {...}.
  (Perl 6's Ceval function only evaluates strings, not blocks.)
 -A Ctry block by default has a CCATCH block that handles all
 +A Ctry block by default has a CCATCH block that handles all fatal
  exceptions by ignoring them.  If you define a CCATCH block within
  the Ctry, it replaces the default CCATCH.  It also makes the Ctry
  keyword redundant, because any block can function as a Ctry block

OK; so any block with a CATCH block in it is effectively a 'try' block...

  our multi method warn ( Object $o: ) is export

 -Prints a warning to C$*ERR, which is usually finds C$PROCESS::ERR. See
 -CSynopsis 16: IPC / IO / Signals for details.
 +Throws a resumable warning exception, which is considered a control
 +exception, and hence is invisible to most normal exception handlers.
 +The outermost control handler will print the warning to C$*ERR
 +(which is usually finds C$PROCESS::ERR; see CSynopsis 16: IPC /
 +IO / Signals for details).  After printing the warning, the exception
 +is resumed where it was thrown.  To override this behavior, catch the
 +exception in a CONTROL block.  A quietly {...} block is the opposite of a
 +try {...} block in that it will suppress any warnings but pass fatal
 +exceptions through.

...while any block with a CONTROL block in it is effectively a
'quietly' block.  Right?  If so, could this be spelled out in S04,
immediately after the discussion about 'try'?

-- 
Jonathan Dataweaver Lang