Hi Benito,
We considered this decision point during JSONiq design. There are several reasons for this decision that I can give you background about.
1. XQuery/JSONiq supports trees, not graphs (like Java or C++ would) -- at least not directly (but it does in the form of RDF triples, for example).
2. If you work against JSON data stores (like we do on
28.io), it makes sense that parents "own" their children values. References would get lost upon persisting unless you add the necessary machinery.
3. An implementation is free to optimize and not do copying if it is able to infer that this is transparent to the user (i.e., no identity exposure, etc).
XQuery 3.1's maps might behave as you expect though.
I hope this helps?
Kind regards,
Ghislain
> --
> You received this message because you are subscribed to the Google Groups "JSONiq" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to
jsoniq+un...@googlegroups.com.
> For more options, visit
https://groups.google.com/d/optout.