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

Ketan Maheshwari ketancmaheshwari at gmail.com
Mon Apr 1 15:50:23 CDT 2013


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/swift-devel/attachments/20130401/bb440034/attachment.html>


More information about the Swift-devel mailing list