[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qexo-general] Possible variable scoping bug
From: |
Joseph Coffland |
Subject: |
[Qexo-general] Possible variable scoping bug |
Date: |
Thu, 26 Feb 2004 13:17:30 -0500 |
Per Bother,
> Here's a workaround. It looks like it may be broken in the CVS
> version (I'll take a look), but it works in 1.7.90.
>
> $ cat /tmp/prop.xql
> declare variable $x { java.lang.System:getProperty("x", "unknown") };
> declare variable $y { java.lang.System:getProperty("y", "unknown") };
> "The value of x is ",$x, " while y is ",$y,"
> "
>
> $ java -Dx='X-value' -jar kawa-1.7.90.jar -f /tmp/prop.xql
> The value of x is X-value while y is unknown
Your example worked fine using the kawa-1.7.90 release. Then I had this
problem.
Add one line to your example:
declare variable $x { java.lang.System:getProperty("x", "unknown") };
declare variable $y { java.lang.System:getProperty("y", "unknown") };
let $test := "test" return
"The value of x is ",$x, " while y is ",$y,"
"
And I get this error:
gnu.mapping.UnboundSymbol: Unbound symbol x
at
gnu.expr.Interpreter.getDefaultSymbolValue(Interpreter.java:651)
at gnu.expr.Interpreter.getSymbolValue(Interpreter.java:658)
at atInteractiveLevel.apply(test.xql:5)
at gnu.mapping.CallContext.runUntilDone(CallContext.java:289)
at gnu.expr.ModuleExp.evalModule(ModuleExp.java:188)
at kawa.Shell.run(Shell.java:233)
at kawa.standard.load.loadSource(load.java:162)
at kawa.standard.load.apply(load.java:275)
at kawa.Shell.runFile(Shell.java:298)
at kawa.repl.processArgs(repl.java:241)
at kawa.repl.main(repl.java:660)
It seems that code inside the FLOWR expressions scope cannot reach up to
global scope.
Joseph
--
Joseph Coffland
address@hidden
- [Qexo-general] TreeList implementation, Joseph Coffland, 2004/02/24
- [Qexo-general] Re: TreeList implementation, Per Bothner, 2004/02/24
- [Qexo-general] Re: TreeList implementation, Joseph Coffland, 2004/02/24
- Re: [Qexo-general] Re: TreeList implementation, Per Bothner, 2004/02/25
- Re: [Qexo-general] Re: TreeList implementation, Joseph Coffland, 2004/02/25
- Re: [Qexo-general] Re: TreeList implementation, Per Bothner, 2004/02/25
- Re: [Qexo-general] Re: TreeList implementation, Joseph Coffland, 2004/02/26
- Re: [Qexo-general] Re: TreeList implementation, Per Bothner, 2004/02/26
- Re: [Qexo-general] Re: TreeList implementation, Joseph Coffland, 2004/02/26
- [Qexo-general] Possible variable scoping bug,
Joseph Coffland <=
- [Qexo-general] Re: Possible variable scoping bug, Per Bothner, 2004/02/26