<dict ...> patterns in dataspacePatterns.prs need an ordering specified #3

Open
opened 2022-06-01 13:45:25 +00:00 by tonyg · 1 comment
Owner

<dict ...> patterns in dataspacePatterns.prs need an ordering specified, because bindings are numbered, not named.

Proposal: require traversal of subpatterns in Preserves-order of keys in the pattern.

Alternative possibility: have <dict [[@key any @pattern Pattern] ...]> with a side-condition on uniqueness of keys. Upside is doesn't require sorting in the match implementation; downsides are (1) patterns that should compare equal don't (2) side-condition means a separate validation step on a pattern has to be performed after it is read and parsed.

`<dict ...>` patterns in dataspacePatterns.prs need an ordering specified, because bindings are *numbered*, not named. Proposal: require traversal of subpatterns in Preserves-order of keys in the pattern. Alternative possibility: have `<dict [[@key any @pattern Pattern] ...]>` with a side-condition on uniqueness of `key`s. Upside is doesn't require sorting in the match implementation; downsides are (1) patterns that should compare equal don't (2) side-condition means a separate validation step on a pattern has to be performed after it is read and parsed.
Author
Owner

Ordering specified here: https://synit.org/book/protocols/syndicate/dataspacePatterns.html#compound. Probably also should be spelled out in dataspacePatterns.prs itself?

Ordering specified here: https://synit.org/book/protocols/syndicate/dataspacePatterns.html#compound. Probably also should be spelled out in `dataspacePatterns.prs` itself?
Sign in to join this conversation.
No Label
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: syndicate-lang/syndicate-protocols#3
No description provided.