[Swift-devel] unitialized error when swift app returning a non-file type
Ketan Maheshwari
ketancmaheshwari at gmail.com
Mon Apr 1 16:18:52 CDT 2013
To my understanding, it has to be used in the commandline so that Swift
knows where to put its value.
Here is a variant which does not use it in command line but nothing is
returned too:
app (string _b) s_app(string a){
str_app a;
}
string[] b;
foreach i in [0:10]{
b[i]= s_app("hello");
tracef("%s\n", b[i]);
}
$ swift str.swift -tc.file tc -sites.file sites.xml
Swift trunk swift-r6410 cog-r3648
RunID: 20130401-1617-4k42kvp5
Progress: time: Mon, 01 Apr 2013 16:17:58 -0500
null
null
Progress: time: Mon, 01 Apr 2013 16:17:59 -0500 Selecting site:8 Stage
in:1 Finished successfully:2
null
null
Progress: time: Mon, 01 Apr 2013 16:18:01 -0500 Selecting site:6 Stage
in:1 Finished successfully:4
null
null
Progress: time: Mon, 01 Apr 2013 16:18:02 -0500 Selecting site:4 Stage
in:1 Finished successfully:6
null
null
Progress: time: Mon, 01 Apr 2013 16:18:03 -0500 Selecting site:2 Stage
in:1 Finished successfully:8
null
null
Progress: time: Mon, 01 Apr 2013 16:18:05 -0500 Stage in:1 Finished
successfully:10
null
Final status: Mon, 01 Apr 2013 16:18:05 -0500 Finished successfully:11
On Mon, Apr 1, 2013 at 4:10 PM, Mihael Hategan <hategan at mcs.anl.gov> wrote:
> Wait, it's no bug.
>
> It's a poor error message. This refers to the 'b' that is a return
> parameter in s_app. You are using it as an input parameter on the
> command line.
>
> Mihael
>
> On Mon, 2013-04-01 at 14:03 -0700, Mihael Hategan wrote:
> > It's a bug. Working on it.
> >
> > On Mon, 2013-04-01 at 15:50 -0500, Ketan Maheshwari wrote:
> > > Hi,
> > >
> > > Wondering if this is an expected behavior. I intend a Swift app to
> return a
> > > variable which I then receive in a Swift variable. This variable is
> > > uninitialized since initializing it would close it out.
> > >
> > > Here is a minuscule example:
> > >
> > > app (string b) s_app(string a){
> > > str_app a b;
> > > }
> > >
> > > string[] b;
> > >
> > > foreach i in [0:10]{
> > > b[i]= s_app("hello");
> > > }
> > >
> > > The s_app links to a bash script as follows:
> > >
> > > #!/bin/bash
> > >
> > > $2=$1
> > >
> > > On running this:
> > >
> > > $ swift str.swift -tc.file tc -sites.file sites.xml
> > > Could not start execution
> > > Uninitalized variable: b
> > >
> > >
> > > The detailed exception from the log is:
> > > 2013-04-01 15:47:33,755-0500 DEBUG Loader Detailed exception:
> > > org.griphyn.vdl.karajan.CompilationException: Uninitalized variable: b
> > > at
> > > org.griphyn.vdl.engine.VariableScope.undeclare(VariableScope.java:1143)
> > > at
> > >
> org.griphyn.vdl.engine.VariableScope.analyzeWriters(VariableScope.java:1119)
> > > at
> > >
> org.griphyn.vdl.engine.VariableScope.analyzeWriters(VariableScope.java:1115)
> > > at
> > >
> org.griphyn.vdl.engine.VariableScope.analyzeWriters(VariableScope.java:1115)
> > > at
> > >
> org.griphyn.vdl.engine.VariableScope.analyzeWriters(VariableScope.java:1085)
> > > at org.griphyn.vdl.engine.Karajan.program(Karajan.java:316)
> > > at org.griphyn.vdl.engine.Karajan.compile(Karajan.java:137)
> > > at org.griphyn.vdl.karajan.Loader.compile(Loader.java:351)
> > > at org.griphyn.vdl.karajan.Loader.main(Loader.java:172)
> > >
> > > Thanks for any help.
> > >
> > > Hi,
> > >
> > >
> > > Wondering if this is an expected behavior. I intend a Swift app to
> > > return a variable which I then receive in a Swift variable. This
> > > variable is uninitialized since initializing it would close it out.
> > >
> > >
> > > Here is a minuscule example:
> > >
> > >
> > > app (string b) s_app(string a){
> > > str_app a b;
> > > }
> > >
> > >
> > > string[] b;
> > >
> > >
> > > foreach i in [0:10]{
> > > b[i]= s_app("hello");
> > > }
> > >
> > >
> > > The s_app links to a bash script as follows:
> > >
> > >
> > > #!/bin/bash
> > >
> > >
> > > $2=$1
> > >
> > >
> > > On running this:
> > >
> > >
> > > $ swift str.swift -tc.file tc -sites.file sites.xml
> > > Could not start execution
> > > Uninitalized variable: b
> > >
> > >
> > >
> > >
> > > The detailed exception from the log is:
> > > 2013-04-01 15:47:33,755-0500 DEBUG Loader Detailed exception:
> > > org.griphyn.vdl.karajan.CompilationException: Uninitalized variable: b
> > > at
> > > org.griphyn.vdl.engine.VariableScope.undeclare(VariableScope.java:1143)
> > > at
> > >
> org.griphyn.vdl.engine.VariableScope.analyzeWriters(VariableScope.java:1119)
> > > at
> > >
> org.griphyn.vdl.engine.VariableScope.analyzeWriters(VariableScope.java:1115)
> > > at
> > >
> org.griphyn.vdl.engine.VariableScope.analyzeWriters(VariableScope.java:1115)
> > > at
> > >
> org.griphyn.vdl.engine.VariableScope.analyzeWriters(VariableScope.java:1085)
> > > at org.griphyn.vdl.engine.Karajan.program(Karajan.java:316)
> > > at org.griphyn.vdl.engine.Karajan.compile(Karajan.java:137)
> > > at org.griphyn.vdl.karajan.Loader.compile(Loader.java:351)
> > > at org.griphyn.vdl.karajan.Loader.main(Loader.java:172)
> > >
> > >
> > > Thanks for any help.
> > >
> > >
> > > --
> > > Ketan
> > >
> > >
> > > _______________________________________________
> > > Swift-devel mailing list
> > > Swift-devel at ci.uchicago.edu
> > > https://lists.ci.uchicago.edu/cgi-bin/mailman/listinfo/swift-devel
> >
> >
> > _______________________________________________
> > Swift-devel mailing list
> > Swift-devel at ci.uchicago.edu
> > https://lists.ci.uchicago.edu/cgi-bin/mailman/listinfo/swift-devel
>
>
>
--
Ketan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/swift-devel/attachments/20130401/192e84d3/attachment.html>
More information about the Swift-devel
mailing list