3 ms·
The introduction keeps citing "no need for escaping or quoting" as a major advantage, but provides no examples of what a key with a colon, or value beginning wi
by morelisp 5y ago
The introduction keeps citing "no need for escaping or quoting" as a major advantage, but provides no examples of what a key with a colon, or value beginning with "[", or any datum with leading or trailing whitespace would look like.
Also, the changelog is quite frightening!
> [In 3.0], `[ ]` now represents a list that contains an empty string, whereas previously it represented an empty list.
- matzf 5y agoThis made my curious to find out. The "Language introduction" docs [1] answers these points; * keys containing leading spaces, newlines or colons can be represented with the multiline key form, where each line of the key starts with `: `. * leading or trailing space is not complicated; the string values are just the rest of the line after the separator from the key, `: `. The values are not trimmed. * a string value beginning with `[` just works in most places. This would not be confused with list values, as these would only start after a new line. Only in the compact inline list and inline dict form there are restricted characters for syntax. It seems that their claim, no escaping required, holds. The slightly more verbose form of the language constructs may be required to represent special values though. [1]: https://nestedtext.org/en/stable/basic_syntax.html https://nestedtext.org/en/stable/basic_syntax.html