3 ms·
Depends on the other focuses of the language. Option/Maybe monads are one option popular in static functional languages. For set oriented languages, an empty
by dragonwriter 8y ago
Depends on the other focuses of the language.
Option/Maybe monads are one option popular in static functional languages.
For set oriented languages, an empty set is an option. (This is very similar to the previous option, actually.)
Null is kind of a middle ground between these options and a ad hoc use of a specific sentinel value like using a signed integer variable when the data is logically unsigned, so you can use “-1” for missing data.
- hzhou321 8y agoI see. So the idea of NULL is the idea of sentinel value. And to express the idea of sentinel value is to create a wrapper around the value and have the wrapper always check for sentinel by default. Is this interpretation correct? So I guess the better question is how do you express the idea of skipping checking for Sentinel when the language always checks for sentinel?
- matt_kantor 8y agoWhat do you want the runtime behavior to be if the sentinel value is produced?