Re:A Conversation with Language Creators: Guido, James, Ande...
by hzhou321 on Thursday April 04, 2019 @10:27PM
(#19579110)
I 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?
Re:A Conversation with Language Creators: Guido, James, Ande...
by matt_kantor on Thursday April 04, 2019 @11:59PM
(#19579565)
What do you want the runtime behavior to be if the sentinel value is produced?
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.