New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
run builtin #61
Labels
Comments
From zev-perl6@strangersgate.comImplementation of the C<run> builtin (except they don't return a Zev |
From zev-perl6@strangersgate.comrun.patchIndex: 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, *@args )
+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:
|
From @pmichaudApplied by PerlJam++ in r28407. Thanks! Pm |
1 similar comment
From @pmichaudApplied by PerlJam++ in r28407. Thanks! Pm |
@pmichaud - Status changed from 'new' to 'resolved' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Migrated from rt.perl.org#50558 (status was 'resolved')
Searchable as RT50558$
The text was updated successfully, but these errors were encountered: