<div dir="ltr">I was thinking Swift would take a placeholder for 'r' which would be a command line arg and would expect the placeholder be filled with value in the app call. However, I agree that in this example it would be counter intuitive and perhaps unsuitable. <div>
<br></div><div style>Does this mean that a Swift app can only return a file type? </div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Apr 1, 2013 at 4:49 PM, Mihael Hategan <span dir="ltr"><<a href="mailto:hategan@mcs.anl.gov" target="_blank">hategan@mcs.anl.gov</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">What do you think should appear on the command line for echo in the<br>
following case:<br>
<br>
app (string r) f() {<br>
echo r;<br>
}<br>
<br>
string s;<br>
s = f();<br>
?<br>
<span class="HOEnZb"><font color="#888888"><br>
Mihael<br>
</font></span><div class="HOEnZb"><div class="h5"><br>
On Mon, 2013-04-01 at 16:33 -0500, Ketan Maheshwari wrote:<br>
> Consider the following variant of above example:<br>
><br>
> type file;<br>
><br>
> app (file _b) s_app(string a){<br>
> str_app a @_b;<br>
> }<br>
><br>
> file b[]<simple_mapper; location=".", prefix="b_",suffix=".out">;<br>
><br>
> foreach i in [0:10]{<br>
> b[i]= s_app("hello");<br>
> }<br>
><br>
> And the corresponding bash script that app links to:<br>
><br>
> #!/bin/bash<br>
><br>
> echo "$1">$2<br>
><br>
> This variant exhibits the same pattern as the previous one except that b<br>
> now is a file type variable. The original example which did not work<br>
> involved b as a non-file type variable (string).<br>
><br>
> Since this one works, I understood the one with other types should also<br>
> work.<br>
><br>
><br>
><br>
> On Mon, Apr 1, 2013 at 4:23 PM, Mihael Hategan <<a href="mailto:hategan@mcs.anl.gov">hategan@mcs.anl.gov</a>> wrote:<br>
><br>
> > On Mon, 2013-04-01 at 16:18 -0500, Ketan Maheshwari wrote:<br>
> > > To my understanding, it has to be used in the commandline so that Swift<br>
> > > knows where to put its value.<br>
> ><br>
> > I'm not sure what you mean there, or where you got that information, but<br>
> > when you say<br>
> ><br>
> > app ... {<br>
> > appname x;<br>
> > }<br>
> ><br>
> > that means invoke 'appname' with the value of x as a parameter on the<br>
> > command line. There is no such value if x is a return parameter.<br>
> ><br>
> > Mihael<br>
> ><br>
> ><br>
> ><br>
><br>
><br>
> Consider the following variant of above example:<br>
><br>
><br>
> type file;<br>
><br>
><br>
> app (file _b) s_app(string a){<br>
> str_app a @_b;<br>
> }<br>
><br>
><br>
> file b[]<simple_mapper; location=".", prefix="b_",suffix=".out">;<br>
><br>
><br>
> foreach i in [0:10]{<br>
> b[i]= s_app("hello");<br>
> }<br>
><br>
><br>
> And the corresponding bash script that app links to:<br>
><br>
><br>
> #!/bin/bash<br>
><br>
><br>
> echo "$1">$2<br>
><br>
><br>
> This variant exhibits the same pattern as the previous one except that<br>
> b now is a file type variable. The original example which did not work<br>
> involved b as a non-file type variable (string).<br>
><br>
><br>
> Since this one works, I understood the one with other types should<br>
> also work.<br>
><br>
><br>
><br>
><br>
> On Mon, Apr 1, 2013 at 4:23 PM, Mihael Hategan <<a href="mailto:hategan@mcs.anl.gov">hategan@mcs.anl.gov</a>><br>
> wrote:<br>
> On Mon, 2013-04-01 at 16:18 -0500, Ketan Maheshwari wrote:<br>
> > To my understanding, it has to be used in the commandline so<br>
> that Swift<br>
> > knows where to put its value.<br>
><br>
><br>
> I'm not sure what you mean there, or where you got that<br>
> information, but<br>
> when you say<br>
><br>
> app ... {<br>
> appname x;<br>
> }<br>
><br>
> that means invoke 'appname' with the value of x as a parameter<br>
> on the<br>
> command line. There is no such value if x is a return<br>
> parameter.<br>
><br>
> Mihael<br>
><br>
><br>
><br>
><br>
><br>
><br>
> --<br>
> Ketan<br>
><br>
><br>
<br>
<br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><font face="'courier new', monospace">Ketan</font><br><br>
</div>