Skip to content

Expression for exploding "complex atomics" to maps聽#23

Description

@ghislainfourny

This is a counterproposal to the extension of the ? syntax to "complex atomics" such as dates.

The idea is that

Expr 馃巻

explodes an atomic (like date, etc...) returned by Expr into a map (with fields year, month, etc).

(the choice of 馃巻 is arbitrary and a placeholder for any other reasonable choice of syntax)

It can also work on a sequence of atomics, returning a sequence of maps.

Then one can write

(current-date():fireworks: )?year

where the semantics of ? is completely unchanged.

Parentheses are here for clarity on precedence, but may or may not be needed depending on the relative precedence of 馃巻 and ?.

This way, 馃巻 could be combined and used with all other functionality applying to maps (functions, obtaining the keys, the values, etc), providing a more general functionality than only for ?-based lookup.

As raised in Slack, it would be clear to anybody seeing 馃巻 and getting an error with an XQuery 3.1 query that this is something new, rather than an existing ? with modified semantics

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions