Order top-level imports, requires, aliases, and uses #75
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)
Let's normalize solutions by ordering all of those expressions in this order:
alias
es, ordered alphabetically by the moduleuse
s, ordered alphabetically by the modulerequires
s, ordered alphabetically by the moduleimports
s, ordered alphabetically by the moduleAll I know is that aliases need to be first because they might affect the other ones (e.g.
alias A.B.C; import C
won't compile if you swap the order), but the order of the other expressions I chose arbitrarily. Do we have any reasons for any specific order?Let's not touch any of those expressions that appear after the first function/macro/guard definition. In theory we could also order those expressions when they appear at the top of a function definition, but that's a rare case so maybe there's no point?
Example input:
Desired output
The text was updated successfully, but these errors were encountered: