brunoborges / toml-schema

MIT License
61 stars 2 forks source link

Change name of `sequence` concept to `collection` #6

Closed brunoborges closed 3 years ago

brunoborges commented 3 years ago

The sequence type as it's currently defined is an excellent concept. But the name "sequence" is terrible, and a different name ought to be chosen.

Defining a "sequence" with the typeof key is a stellar idea, because it quickly gathers together common data under a single table and allows names to be expressed as parts of table headers. It brings both dynamism and order to TOML by encapsulating an eminently simple means to keep the names useful and to prevent context-free name keys from sprouting up needlessly.

However, the word "sequence" implies that the subtable names have a fixed order. That is not necessarily the case. The names are treated like keys in the sequence table, meaning that they are not ordered by default.

I would suggest a different name for this type. The word that immediately springs to mind is collection. But that word could be confused with a VB-style Collection, which does possess an inherent order. Since this isn't universal, the name collection may still work. Other potential names include set (could be confused for a group of unique values), relation (from database theory but not widely known), or group (which I like but is an overly broad term).

Originally posted by @eksortso in https://github.com/brunoborges/toml-schema/discussions/5

eksortso commented 3 years ago

I have a PR in the works to replace the name of this type with "collection", and to adjust the README.md to state that a collection can be represented by subtables of a common table in TOML. I'm also replacing "childs" with "children", which I wouldn't fuss about normally, except that I encountered it while updating the text for collections.