[Swift-devel] New built-in system, request for comments

Mihael Hategan hategan at mcs.anl.gov
Fri Apr 4 17:47:17 CDT 2014


I think that from a language design perspective there two important
questions to ask:

1. Can you reasonably achieve the same with existing swift features?
2. Where else would system() be useful?

Mihael

On Fri, 2014-04-04 at 12:08 -0500, Yadu Nand wrote:
> Hi,
> 
> I have just added a new builtin "system" to trunk. It takes a string,
> which is executed in the shell
> by java and the results are returned as an array. This is done to make
> mappings easier, for example,
> you can map an entire folder "foo" using the following :
> 
> file folder[ ] < array_mapper; files = system ("find foo -type f") >;
> 
> If the execution of the string provided fails, the logger would report
> the the exitcode and stderr to
> the swift stdout.
> 
> Thanks,
> Yadu Nand B
> _______________________________________________
> Swift-devel mailing list
> Swift-devel at ci.uchicago.edu
> https://lists.ci.uchicago.edu/cgi-bin/mailman/listinfo/swift-devel





More information about the Swift-devel mailing list