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

Order map and struct keys #74

Closed
angelikatyborska opened this issue Sep 3, 2022 · 0 comments · Fixed by #77
Closed

Order map and struct keys #74

angelikatyborska opened this issue Sep 3, 2022 · 0 comments · Fixed by #77
Assignees
Labels
x:action/improve Improve existing functionality/content x:knowledge/intermediate Quite a bit of Exercism knowledge required x:module/representer Work on Representers x:size/medium Medium amount of work x:type/coding Write code that is not student-facing content (e.g. test-runners, generators, but not exercises)

Comments

@angelikatyborska
Copy link
Member

angelikatyborska commented Sep 3, 2022

The order in which map and struct keys are defined shouldn't matter. We could order them alphabetically.

For example:

Input:

%Time{
  hour: 1,
  minute: 30,
  seconds: 0,
  microsecond: {0, 0},
  calendar: Calendar.ISO
}

Desired representation:

%Time{
  calendar: Calendar.ISO,
  hour: 1,
  microsecond: {0, 0},
  minute: 30,
  seconds: 0
}

Important: don't do this for keyword lists.

The issue of whether keys will be replaced by placeholders is still open, so make sure to sort the keys before they are replaced (if they will get replaced).

@angelikatyborska angelikatyborska added x:action/improve Improve existing functionality/content x:knowledge/intermediate Quite a bit of Exercism knowledge required x:module/representer Work on Representers x:type/coding Write code that is not student-facing content (e.g. test-runners, generators, but not exercises) x:size/medium Medium amount of work labels Sep 3, 2022
@jiegillet jiegillet self-assigned this Sep 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
x:action/improve Improve existing functionality/content x:knowledge/intermediate Quite a bit of Exercism knowledge required x:module/representer Work on Representers x:size/medium Medium amount of work x:type/coding Write code that is not student-facing content (e.g. test-runners, generators, but not exercises)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants