The Scala language spec (SLS), https://scala-lang.org/files/archive/spec/2.13/, has identifiers for its sections (and sub-sections) so, for instance, SLS 8.5 is about “Pattern Matching Anonymous Functions”: https://scala-lang.org/files/archive/spec/2.13/08-pattern-matching.html#pattern-matching-anonymous-functions.
I’ve seen people refer to sections of the spec by such numbers (e.g. “as defined in SLS 8.5”) however I was surprised to see that those numbers are derived and don’t actually exist in the source: https://github.com/scala/scala/blob/v2.13.0/spec/08-pattern-matching.md#pattern-matching-anonymous-functions. Meaning that “8.5” could refer to something else (let’s say within the 2.13 spec alone) if a section is added or if a section is removed (such as two sections merging into one).
Do we have a system in place to prevent this? Is it just part of the spec upkeep to safeguard against any such section changes within a major (e.g. 2.13) version of Scala?
My initial idea was to manually number the sections so that any changes would be more clear and obvious, but do you think that’s worth it or a good idea? A side-benefit would be that I wouldn’t need to see a rendered version (or, worst yet, manually count) to figure out in 08-pattern-matching.md which section is “SLS 8.5”.