4 ms·
I'm surprised in a discussion of when to quote or not quote with YAML the dreaded "yes", "no", "true", "false", "on", and "off" booleans didn't come up. Quotin
by merlincorey 4y ago
I'm surprised in a discussion of when to quote or not quote with YAML the dreaded "yes", "no", "true", "false", "on", and "off" booleans didn't come up.
Quoting the article:
> In YAML, you can write a string without quotes, if it doesn't have a special meaning.
Yeah, about that...
- AceJohnny2 4y agoIndeed the if is doing a lot of work there ;) What parent refers to, YAML's Norway Problem: https://hitchdev.com/strictyaml/why/implicit-typing-removed/ https://hitchdev.com/strictyaml/why/implicit-typing-removed/
- Defletter 4y agoDidn't realise YAML's problems were that extensive, but I have to disagree with the seeming decision to effectively parse everything as strings instead of requiring all strings be quoted.
- AceJohnny2 4y agoit's really a good lesson in "make it human-readable" being at odds with "make it easily parseable"
- deleted 4y ago[deleted]
- deleted 4y ago[deleted]
- emmelaich 4y agoIt is mentioned though ... > Another use case for quotes is when you have a string that would be resolved as a special type. This highly depends on the YAML version and on the Schema in use. Here are some examples where you need quotes: true, false 23 1e3 3.14159 null
- Spivak 4y agoEh, YAML 1.2 fixed this. It's only true/false now. The set of values that are special is pretty sane now. true, false, null, <ints>, <floats>