Writing the docs, I still struggle to explain the role of the elements() and indices() functions, and I think they’re still quite confusing. So what if we finally deprecated them and let you just use element(), value(), index(), and key() instead? That is, we would accept:
- max(element(experiment.measurements)), max(index(record.revisions))
- 0.0 < every element(experiment.measurements), 1 = any index(record.revisions)
- 1 in index(record.revisions), "hibernate" in element(document.tags)
In case 1, the revised syntax reads significantly better. In case 2, the revised syntax reads better if you use the every / any form of the quantifiers, or worse if you use the all/ some version. In case 3, the revised syntax reads definitely worse. But how useful is in with collections when we also have:
- member of , and
- the option of writing 1 = any index(record.revisions).
Or perhaps we could just make elements a synonym for element and indices a synonym for index and let you write whatever you like. Thoughts? |