Re: Deep update of maps and arrays

Hi Michael,

Thanks for spending time and effort on this much expected feature.

It seems that the rendered preview has not been updated yet [1], but in principle it’s already possible to browse through the PR [2].

In a previous meeting, we believed it could be helpful to have high-level use cases written down before choosing a final syntax. Do you think that would still be helpful?

With XQUF, it would be trivial to define an fn:update function as a replacement for copy/modify/return:

  fn:update($xml, fn {
    delete nodes .//city,
    insert node <country/> into ./person
  })

Maybe we could introduce such a generic function for both XML and maps/arrays (with 'node/nodes' replaced by 'values').

Best,
Christian

[1] https://qt4cg.org/pr/832/xquery-40/xquery-40-autodiff.html

[2] https://github.com/qt4cg/qtspecs/pull/832/files




Am 29.02.2024 13:27 schrieb Michael Kay <mike@saxonica.com>:
I've submitted a revision (actually a total rewrite, but reusing the same ideas) of the PR on deep update.

It still needs some polishing, such as addition of notes and examples, but it's now ready for a detailed review.

Michael Kay
Saxonica

Received on Thursday, 29 February 2024 14:49:27 UTC