[Swift-user] Expanding arrays in app function command lines

Michael Wilde wilde at mcs.anl.gov
Tue Jan 27 10:26:54 CST 2009


Thanks, Ben.  The example looks good - that seems the natural way to 
express it.

Might want to specify/test the following:

- array of other scalar types, coerced into string in the cmd line
- struct? (expand the fields in source-code order)?
- array of struct etc

Or for now just fail the cases that are not easy to support?

The struct case would be handy for the oops code that is using the 
parameter-string array case: the app returns 5 files; would be nice to 
specify them as a struct type and pass a single argument for results 
called "oops_results". Same for its 3 input files.

- Mike


On 1/27/09 10:11 AM, Ben Clifford wrote:
> On Mon, 26 Jan 2009, Ben Clifford wrote:
> 
>>> But in general, the ability to expand an array of strings into the command
>>> line is useful and I think should be done in array member order.
>>> Can/should this be changed to behave like that?
>> yes, this is something I've been meaning to work on.
> 
> http://www.ci.uchicago.edu/~benc/tmp/argstar.patch
> 
> will allow you to specify arrays of strings directly as parameters.
> 
> http://www.ci.uchicago.edu/~benc/tmp/strarray.swift demonstrates the use 
> of such.
> 
> You can apply that, or you can wait a few days more me to test it more 
> thoroughly and commit.
> 
> Note that instead of saying x[*] you would say x without further 
> modifiers.
> 



More information about the Swift-user mailing list