[Swift-user] Expanding arrays in app function command lines
Michael Wilde
wilde at mcs.anl.gov
Tue Feb 3 09:55:07 CST 2009
A few comments on this topic related to the vote Ben called:
Using the simple array or structure name on the app command line is good.
Having the members expanded in index and/or source order is good.
Expanding the members as separate args seems best, as that bypasses
issues of deciding on separators and whitespace between members. Users
who want to pass several members as one can apply some sort of
concatenation and determine their own separators.
So I'm in favor of the approach used in this patch.
I'll cast my vote +1 as soon as I can apply the patch and test, to make
sure Im not missing anything. I need to change my scripts to handle the
new convention.
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