You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
under the initial literals section that @lerno mentioned, we add a brief note stating that literals for advanced types are explained under their respective sections, possibly with a list of links to each section.
then we scan all the advanced type sections and make sure we list each accepted literal format/style for every type.
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
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.The text was updated successfully, but these errors were encountered: