Hi,
When looking for a good example for the documentation, I came across the
following issue in Object key listing and Array unboxing:
The code
let $x := {
“name” : {“id” : 123, “first” : “Riyafa”, “Last” : “Abdul
Hameed”}}return $x(“name”)()
returns
{“id” : 123, “first” : “Riyafa”, “Last” : “Abdul Hameed”}
but the code,
let $x := {
“name” : {“id” : 123, “first” : “Riyafa”, “Last” : “Abdul Hameed”}}
let $y := $x(“name”)return $y()
returns
id
first
Last
But, as I understand both code should return:
id
first
Last
The same issue is present in Array unboxing:
For example the code
let $x := [[ “mercury”, “venus”, “earth”, “mars” ],[ “monday”,
“tuesday”, “wednesday”, “thursday” ]]return $x(1)()
returns
[ “mercury”, “venus”, “earth”, “mars” ]
while the code
let $x := [[ “mercury”, “venus”, “earth”, “mars” ],[ “monday”,
“tuesday”, “wednesday”, “thursday” ]]
let $y := $x(1)return $y()
returns
mercury
venus
earth
mars
Here also I think both should return:
mercury
venus
earth
mars
I would like to know whether this is a language feature or if its an
implementation issue. If it’s an implementation issue I am not sure I
understand where the issue is. Any suggestions would be highly appreciated.
--
Riyafa Abdul Hameed
Undergraduate, University of Moratuwa
Email: [email protected]
Website: https://riyafa.wordpress.com/ <http://riyafa.wordpress.com/>
<http://facebook.com/riyafa.ahf> <http://lk.linkedin.com/in/riyafa>
<http://twitter.com/Riyafa1>