# New Ticket Created by  Zev Benjamin 
# Please include the string:  [perl #50558]
# in the subject line of all future correspondence about this issue. 
# <URL: http://rt.perl.org/rt3/Ticket/Display.html?id=50558 >


Implementation of the C<run> builtin (except they don't return a
C<Proc::Status>).


Zev

Index: languages/perl6/config/makefiles/root.in
===================================================================
--- languages/perl6/config/makefiles/root.in	(revision 25537)
+++ languages/perl6/config/makefiles/root.in	(working copy)
@@ -60,6 +60,7 @@
   src/builtins/op.pir \
   src/builtins/parrot.pir \
   src/builtins/range.pir \
+  src/builtins/system.pir \
 
 PMCS        = perl6str
 PMC_SOURCES = $(PMC_DIR)/perl6str.pmc
Index: languages/perl6/src/builtins/system.pir
===================================================================
--- languages/perl6/src/builtins/system.pir	(revision 0)
+++ languages/perl6/src/builtins/system.pir	(revision 0)
@@ -0,0 +1,63 @@
+## $Id $
+
+=head1 NAME
+
+src/builtins/system.pir - Perl6 OS-related functions
+
+=head1 Functions
+
+=over 4
+
+=cut
+
+.namespace
+## TODO: should these be in a namespace?
+## .namespace [ '???' ]
+
+=item run
+
+our Proc::Status multi run ( ; Str $command )
+our Proc::Status multi run ( ; Str $path, [EMAIL PROTECTED] )
+our Proc::Status multi run ( Str @path_and_args )
+
+The versions below do not return a C<Proc::Status> object, but instead
+return the status code from the C<spawnw> opcode.
+
+=cut
+
+.sub run :multi(Perl6Str)
+    .param string cmd
+    .local int retval
+
+    spawnw retval, cmd
+    .return (retval)
+.end
+
+.sub run :multi(Perl6Str,List)
+    .param string path
+    .param pmc args :slurpy
+    .local int retval
+
+    unshift args, path
+    spawnw retval, args
+    .return (retval)
+.end
+
+.sub run :multi(List)
+    .param pmc path_and_args
+    .local int retval
+
+    spawnw retval, path_and_args
+    .return (retval)
+.end
+
+=back
+
+=cut
+
+
+# Local Variables:
+#   mode: pir
+#   fill-column: 100
+# End:
+# vim: expandtab shiftwidth=4:

Reply via email to