Hacker News new | past | comments | ask | show | jobs | submit login

Well that would be null right? an absence of the thing.



Null is one way to represent such a value, but it’s hardly the only.

Option-style algebraic types are another, and more or less strictly superior if working in a language with first class support for such, because they force you to explicitly handle the null/None/Empty/whatever case if you’re doing something with it that could fail (basically anything besides assignment or passing it along).


Seems beyond the simplicity TOML was aiming for. Absence is absence in the file, in your programming language you can wrap in whatever trickier you like or is relevant.


The trick is distinguishing empty string vs no value vs key not being present.


Key not being present is no value, key present has value, empty string or otherwise, seems simple enough.

You can add advanced semantics on load, the file does nothing by itself after all.


It’s that “or” that bites you if you aren’t real sure of the semantics in play.


There is no 'or' for a given file, it is declaratively there or it is not. The 'or' semantics are part of your language environment not the toml file.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: