4 ms·
Curious syntax. Why does it require sigils? Why does assignment need both `let` and `:=`?
by danellis 5y ago
Curious syntax. Why does it require sigils? Why does assignment need both `let` and `:=`?
- emmanueloga_ 5y agoThe look and feel of this language is due to its close relationship with XQuery and the XML world, including the syntax. From [1]: XQuery 3.1 was designed with the goal to support additional data structures (maps, arrays) in memory. These structures are mapped to JSON for input and output. XQuery 3.1 has been a W3C recommendation since March 2017. JSONiq was designed with the goal of querying and updating JSON in settings such as document stores. It was also designed by members of the XML Query working group (disclaimer: I am one of them) while investigating various possibilities to support JSON. 1: https://stackoverflow.com/questions/44919443/what-are-the-differences-between-jsoniq-and-xquery-3-1 https://stackoverflow.com/questions/44919443/what-are-the-di...
- oever 5y agoIt's derived from XQuery, a functional language for querying and creating XML and JSON. (I realize that that's not an answer to your question.)
- lichtenberger 5y agoIf you don't want both, then use https://github.com/sirixdb/brackit https://github.com/sirixdb/brackit for instance :)
- ghislainfourny 5y agoThank you for your question. This is, in fact, not an assignment, but a variable binding that is highly optimizable by an execution engine. The let clause is part of the FLWOR expression, works in orchestration with for, where, group by, order by, count, return; the ability to bind variables while doing relational algebra is a feature that is often missed in SQL. JSONiq is functional and, in its core (non scripting) version, does not allow modifying variable values.