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