develooper Front page | perl.cvs.parrot | Postings from December 2008

[svn:parrot] r33791 - trunk/languages/perl6/src/builtins

From:
chromatic
Date:
December 10, 2008 20:53
Subject:
[svn:parrot] r33791 - trunk/languages/perl6/src/builtins
Message ID:
20081211045320.8FF3FCBA89@x12.develooper.com
Author: chromatic
Date: Wed Dec 10 20:53:19 2008
New Revision: 33791

Modified:
   trunk/languages/perl6/src/builtins/control.pir

Log:
[Rakudo] PDX.pm added a basic implementation of warn to Rakudo.  This will need
revision when HLLCompiler and/or Rakudo supports a top-level exception handler.

Modified: trunk/languages/perl6/src/builtins/control.pir
==============================================================================
--- trunk/languages/perl6/src/builtins/control.pir	(original)
+++ trunk/languages/perl6/src/builtins/control.pir	Wed Dec 10 20:53:19 2008
@@ -154,7 +154,6 @@
 
 .sub 'die' :multi(_)
     .param pmc list            :slurpy
-    .local pmc it
     .local string message
     .local pmc ex
 
@@ -292,6 +291,23 @@
     .return (res)
 .end
 
+=item warn
+
+=cut
+
+.sub 'warn'
+    .param pmc list            :slurpy
+    .local pmc it
+    .local string message
+
+    message = list.'join'('')
+    if message > '' goto have_message
+    message = "Warning!  Something's wrong\n"
+  have_message:
+    printerr message
+    .return ()
+.end
+
 
 =back
 
@@ -311,6 +327,12 @@
 
 B<TODO>: Research the exception handling system.
 
+=item warn
+
+B<TODO>: Throw a resumable exception when Rakudo supports top-level exception
+handlers.  Note that the default exception handler should print the message of
+this exception to standard error.
+
 
 =back
 



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About