Open lerno opened 11 months ago
Just taking notes here to use as reference when preparing a PR to resolve this. Please add other things you find missing related to literals.
Considering the less formal style and organization of the document, a good solution would be:
Ranged fields in array literals certainly deserve a paragraph or two with examples.
Another missing piece that I noticed is that there is no mention of struct field tags under struct literals section. However, there is an example of
`fmt:"..."`
later under built-ins section.
The initial parts of the current overview documentation deals with literals: https://odin-lang.org/docs/overview/#lexical-elements-and-literals
However, this section only mentions characters and numbers. It does not mention array literals, which are only implicitly mentioned here: https://odin-lang.org/docs/overview/#fixed-arrays and given an example here: under a different heading: https://odin-lang.org/docs/overview/#slice-literals. Furthermore, I think it might lack some of the ways one can construct array literals.
For maps the situation is similar: https://odin-lang.org/docs/overview/#maps
And furthermore it is not clear if the map initialization also allows you to initialize nested maps, e.g. a map containing a map of ints.
The literals missing from the first part that I have seen are:
true
,false
andnil
could also be considered literals and should probably be listed as well.