valhalla-dev Digest, Vol 17, Issue 5
Rezaei, Mohammad A.
Mohammad.Rezaei at gs.com
Mon Dec 14 15:59:11 UTC 2015
>Previously, however, I did propose a 'T.sentinel' capability, which would
>have provided a "reasonable" sentinel value for most types. Reasonable, not
>perfect, since sentinels are a compromise & prevent use of the complete
>value-space for the type.
Having a sentinel value does *not* preclude that value from being used as a valid value for that type. A properly designed data structure will use a sentinel in a completely encapsulated way, such that the user of the data structure will never need to know what the sentinel is.
For example, most primitive hash structures (e.g. trove, gs collections) use one or more sentinels to represent FREE, REMOVED, etc. The values are implementation dependent, but the user can still store/retrieve those values from these structures.
More information about the valhalla-dev