[Swift-user] Expanding arrays in app function command lines
    Michael Wilde 
    wilde at mcs.anl.gov
       
    Wed Feb  4 17:02:32 CST 2009
    
    
  
Is the expansion of structs into the command line not yet implemented, 
in the latest patch for expanding arrays?
(vdlarg-1.patch) which I have applied.
On 1/27/09 10:29 AM, Ben Clifford wrote:
> On Tue, 27 Jan 2009, Michael Wilde wrote:
> 
>> - array of other scalar types, coerced into string in the cmd line
> 
> I think that might already happen.
> 
> Everything apart from struct has a pretty natural expansion into string 
> args. The source-code order of fields for structs is probably the best, 
> unless someone comes up with a better idea.
This program:
//---
type file;
type struct { string a; string b; };
struct s;
s.a = "a=123";
s.b = "b=456";
app (file o) echo (struct s) { echo s stdout=@o; }
file o<"struct.out">;
o = echo(s);
//---
produces:
com$ cat struct.out
org.griphyn.vdl.mapping.RootDataNode identifier 
tag:benc at ci.uchicago.edu,2008:swift:dataset:20090204-1653-ez43h08a:720000000003 
type struct with no value at dataset=s (closed)
com$
---
I get the same behavior if I also pass s.a and s.b to echo, to make sure 
the fields are set before echo is called:
//---
type file;
type struct { string a; string b; };
struct s;
s.a = "a=123";
s.b = "b=456";
app (file o) echo (struct s, string i, string j) { echo "s=" s "s.a=" 
s.a "s.b=" s.b stdout=@o; }
file o<"struct.out">;
o = echo(s, s.a, s.b );
//---
com$ cat struct.out
s= org.griphyn.vdl.mapping.RootDataNode identifier 
tag:benc at ci.uchicago.edu,2008:swift:dataset:20090204-1700-u8uet3u4:720000000006 
type struct with no value at dataset=s (closed) s.a= a=123 s.b= b=456
com$
    
    
More information about the Swift-user
mailing list