[Swift-devel] unitialized error when swift app returning a non-file type

Mihael Hategan hategan at mcs.anl.gov
Mon Apr 1 16:49:58 CDT 2013


What do you think should appear on the command line for echo in the
following case:

app (string r) f() {
  echo r;
}

string s;
s = f();
?

Mihael

On Mon, 2013-04-01 at 16:33 -0500, Ketan Maheshwari wrote:
> Consider the following variant of above example:
> 
> type file;
> 
> app (file _b) s_app(string a){
>  str_app a @_b;
> }
> 
> file b[]<simple_mapper; location=".", prefix="b_",suffix=".out">;
> 
> foreach i in [0:10]{
>    b[i]= s_app("hello");
> }
> 
> And the corresponding bash script that app links to:
> 
> #!/bin/bash
> 
> echo "$1">$2
> 
> This variant exhibits the same pattern as the previous one except that b
> now is a file type variable. The original example which did not work
> involved b as a non-file type variable (string).
> 
> Since this one works, I understood the one with other types should also
> work.
> 
> 
> 
> On Mon, Apr 1, 2013 at 4:23 PM, Mihael Hategan <hategan at mcs.anl.gov> wrote:
> 
> > On Mon, 2013-04-01 at 16:18 -0500, Ketan Maheshwari wrote:
> > > To my understanding, it has to be used in the commandline so that Swift
> > > knows where to put its value.
> >
> > I'm not sure what you mean there, or where you got that information, but
> > when you say
> >
> > app ... {
> >   appname x;
> > }
> >
> > that means invoke 'appname' with the value of x as a parameter on the
> > command line. There is no such value if x is a return parameter.
> >
> > Mihael
> >
> >
> >
> 
> 
> Consider the following variant of above example:
> 
> 
> type file;
> 
> 
> app (file _b) s_app(string a){
>  str_app a @_b;
> }
> 
> 
> file b[]<simple_mapper; location=".", prefix="b_",suffix=".out">;
> 
> 
> foreach i in [0:10]{
>    b[i]= s_app("hello");
> }
> 
> 
> And the corresponding bash script that app links to:
> 
> 
> #!/bin/bash
> 
> 
> echo "$1">$2
> 
> 
> This variant exhibits the same pattern as the previous one except that
> b now is a file type variable. The original example which did not work
> involved b as a non-file type variable (string).
> 
> 
> Since this one works, I understood the one with other types should
> also work.
> 
> 
> 
> 
> On Mon, Apr 1, 2013 at 4:23 PM, Mihael Hategan <hategan at mcs.anl.gov>
> wrote:
>         On Mon, 2013-04-01 at 16:18 -0500, Ketan Maheshwari wrote:
>         > To my understanding, it has to be used in the commandline so
>         that Swift
>         > knows where to put its value.
>         
>         
>         I'm not sure what you mean there, or where you got that
>         information, but
>         when you say
>         
>         app ... {
>           appname x;
>         }
>         
>         that means invoke 'appname' with the value of x as a parameter
>         on the
>         command line. There is no such value if x is a return
>         parameter.
>         
>         Mihael
>         
>         
> 
> 
> 
> 
> -- 
> Ketan
> 
> 





More information about the Swift-devel mailing list