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

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

From:
tene
Date:
December 14, 2008 22:13
Subject:
[svn:parrot] r33913 - trunk/languages/perl6/src/builtins
Message ID:
20081215061304.EF2EDCBA12@x12.develooper.com
Author: tene
Date: Sun Dec 14 22:13:04 2008
New Revision: 33913

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

Log:
[rakudo]: Update warn() to use an exception.

Modified: trunk/languages/perl6/src/builtins/control.pir
==============================================================================
--- trunk/languages/perl6/src/builtins/control.pir	(original)
+++ trunk/languages/perl6/src/builtins/control.pir	Sun Dec 14 22:13:04 2008
@@ -297,13 +297,22 @@
 
 .sub 'warn'
     .param pmc list            :slurpy
-    .local pmc it
+    .local pmc ex
     .local string message
 
     message = list.'join'('')
     if message > '' goto have_message
     message = "Warning!  Something's wrong\n"
   have_message:
+    ## count_eh is broken
+    # $I0 = count_eh
+    # eq $I0, 0, no_eh
+    ex = new 'Exception'
+    ex['severity'] = .EXCEPT_WARNING
+    ex['message'] = message
+    throw ex
+    .return ()
+  no_eh:
     printerr message
     .return ()
 .end



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