Skip to content

Expression for exploding "complex atomics" to maps #23

@ghislainfourny

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

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