[Swift-devel] Is the use of args within functions legal?

Yadu Nand yadudoc1729 at gmail.com
Wed Sep 18 15:17:02 CDT 2013


Sorry Mihael, I've pasted the error below.
Why does the error go away, when the string assignment statements are
reversed in order?

swift args_trunk.swift -foo="helloFOO"
Swift trunk swift-r7073 (swift modified locally) cog-r3787 (cog modified
locally)
RunID: 20130918-2014-t0fyb8m1
[Error] sites.xml, line 1, col 9: cvc-elt.1: Cannot find the declaration of
element 'config'.
Progress:  time: Wed, 18 Sep 2013 20:14:29 +0000

Execution failed:
java.lang.ClassCastException: Invalid type: expected a
org.griphyn.vdl.mapping.AbstractDataNode but got a
org.globus.cog.karajan.analyzer.InvalidArgChannel
    swiftscript:arg @ args_trunk, line: 22
Caused by: java.lang.ClassCastException: Invalid type: expected a
org.griphyn.vdl.mapping.AbstractDataNode but got a
org.globus.cog.karajan.analyzer.InvalidArgChannel
    at org.griphyn.vdl.karajan.lib.swiftscript.FnArg.function(FnArg.java:63)
    at
org.griphyn.vdl.karajan.lib.SwiftFunction.runBody(SwiftFunction.java:108)
    at
org.globus.cog.karajan.compiled.nodes.InternalFunction.run(InternalFunction.java:154)
    at
org.globus.cog.karajan.compiled.nodes.CompoundNode.runChild(CompoundNode.java:87)
    at
org.globus.cog.karajan.compiled.nodes.InternalFunction.run(InternalFunction.java:147)
    at
org.globus.cog.karajan.compiled.nodes.CompoundNode.runChild(CompoundNode.java:87)
    at
org.globus.cog.karajan.compiled.nodes.Sequential.run(Sequential.java:22)
    at
org.globus.cog.karajan.compiled.nodes.CompoundNode.runChild(CompoundNode.java:87)
    at
org.globus.cog.karajan.compiled.nodes.UParallel$1.run(UParallel.java:68)
    at k.thr.LWThread.run(LWThread.java:228)
    at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    at java.lang.Thread.run(Thread.java:722)

-Yadu



On Wed, Sep 18, 2013 at 3:11 PM, Mihael Hategan <hategan at mcs.anl.gov> wrote:

> Ok, the error is due to the optional value missing. There's shouldn't be
> an error to begin with, but a temporary workaround is:
>
> string FOO = arg("foo", "defaultValue")
>
> On Wed, 2013-09-18 at 14:44 -0500, Yadu Nand wrote:
> > Ketan reported a script failing for him on trunk alone and this is the
> > condensed
> > form of his script that fails consistently on trunk:
> >
> > func() {
> >     string FOO=arg("foo");
> >     string BAR="hello";
> >     tracef("FOO : %s  | BAR : %s\n", FOO, BAR);
> > }
> > func();
> >
> > This script does pass on 0.94RC3, but not on Trunk. Could someone confirm
> > if this
> > is valid syntax ?
> >
> > Reversing the order of the assignments to the following, gets the test to
> > pass:
> >
> > func() {
> >     string BAR="hello";
> >     string FOO=arg("foo");
> >     tracef("FOO : %s  | BAR : %s\n", FOO, BAR);
> > }
> > func();
> >
> >
> > ​Thanks,​
> >
> > Yadu
> > Ketan reported a script failing for him on trunk alone and this is the
> > condensed
> >
> > form of his script that fails consistently on trunk:
> >
> > func() {
> >     string FOO=arg("foo");
> >     string BAR="hello";
> >     tracef("FOO : %s  | BAR : %s\n", FOO, BAR);
> > }
> > func();
> >
> >
> > This script does pass on 0.94RC3, but not on Trunk. Could someone
> > confirm if this
> >
> > is valid syntax ?
> >
> >
> > Reversing the order of the assignments to the following, gets the test
> > to pass:
> >
> > func() {
> >     string BAR="hello";
> >     string FOO=arg("foo");
> >     tracef("FOO : %s  | BAR : %s\n", FOO, BAR);
> > }
> > func();
> >
> >
> >
> >
> > ​Thanks,​
> >
> > Yadu
> > _______________________________________________
> > Swift-devel mailing list
> > Swift-devel at ci.uchicago.edu
> > https://lists.ci.uchicago.edu/cgi-bin/mailman/listinfo/swift-devel
>
>
>


-- 
Yadu Nand B
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/swift-devel/attachments/20130918/2cc2cd42/attachment.html>


More information about the Swift-devel mailing list