Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Records: Introduction? #1494

Open
ChristianGruen opened this issue Oct 10, 2024 · 2 comments
Open

Records: Introduction? #1494

ChristianGruen opened this issue Oct 10, 2024 · 2 comments
Labels
Discussion A discussion on a general topic. Editorial Minor typos, wording clarifications, example fixes, etc. XQuery An issue related to XQuery

Comments

@ChristianGruen
Copy link
Contributor

It has been reported to me that the XQuery specification provides a nice and compact introduction on maps and arrays, but there currently is no comparable introduction for records yet. The “Changes” section on 3.2.8.3 Record Type gives a hint: It contains the sentence “Record types are added as a new kind of ItemType, constraining the value space of maps.”.

In addition, maybe we could rename the section Named Record Types to “Record Declaration”, analogous to “Variable Declaration”, “Context Value Declaration” and “Function Declaration(s)”. “Item Type Declarations” could be renamed to “Type Declaration”.

@ChristianGruen ChristianGruen added XQuery An issue related to XQuery Editorial Minor typos, wording clarifications, example fixes, etc. labels Oct 10, 2024
@michaelhkay
Copy link
Contributor

When you say there's a "nice and compact introduction on maps and arrays", I'm not quite sure what you are referring to. The first substantive mention of maps is in 2.1.1 Values, which is just a forwards reference "Maps (see [4.13.1 Maps]and arrays (see [4.13.2 Arrays] are specific kinds of [function item]s." 4.13.1 is a very terse introduction that doesn't even refer to the XDM specification. Long before that we encounter 3.2.8.2 Map Types, which assumes you already know what maps are, and the highly technical 3.3.2.8 (titled Maps, but actually about Map subtype relationships).

So I think there's rather a challenge in finding a good place for the proposed introduction. Putting such material in the XDM spec, which is probably the most logical place, isn't going to reach a lot of readers.

@ChristianGruen
Copy link
Contributor Author

When you say there's a "nice and compact introduction on maps and arrays", I'm not quite sure what you are referring to.

Good question; I would need to ask back ;)

Looking at the prose, 4.14 Maps and Arrays could be the most appropriate candidate:

“Most modern programming languages have support for collections of key/value pairs, which may be called maps, dictionaries, associative arrays, hash tables, keyed lists, or objects (these are not the same thing as objects in object-oriented systems). In XQuery 4.0, we call these maps. Most modern programming languages also support ordered lists of values, which may be called arrays, vectors, or sequences. In XQuery 4.0, we have both sequences and arrays. […]”

So I think there's rather a challenge in finding a good place for the proposed introduction.

Maybe the section above could be extended to “Maps, Arrays and Records” and some words could be added to explain how records relate to maps.

On the other hand, all this is a lot of extra work that someone would need to do. Perhaps it is generally better to tell everyone who is curious that the spec is aimed at implementers, and that there will be introductions, tutorials and books for those who want to use the language.

@ChristianGruen ChristianGruen added the Discussion A discussion on a general topic. label Oct 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Discussion A discussion on a general topic. Editorial Minor typos, wording clarifications, example fixes, etc. XQuery An issue related to XQuery
Projects
None yet
Development

No branches or pull requests

2 participants