Skip to content

Records/tuples as record keys and sets. Defining an implicit sort for both #392

Open
@sirisian

Description

@sirisian

I realize this concept of records/tuples as keys and unordered tuples (or sets #377 ) are all connected to the same problem of sorting. (Sorting string keys seemed to have been a quick decision).

#{
  #{ a: 0 }: true,
  #{ b: 1 }: true
}
#^[
  #{ a: 0 },
  #{ b: 1 }
]

Essentially to make this work in both cases they'd need to be implicitly sorted by some defined algorithm.

Right now it seems to require the user to manually sort sets to utilize the comparison. This is cumbersome and lacks standardization. Even something as simple as converting a Set of records to a tuple is verbose.

For future consideration it would be nice to have one or both of these features if sorting was defined. To me this seems like something that should be planned as an extension for shortly after the proposal lands if it can't go into the proposal. Maybe it'll get more feedback as people use record/tuple more in projects.

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