Martin Nilsson (Opera Mini - AFK!) @ Pike (-) developers forum wrote:
- I'd much rather see Sql.NULL, with as little fuss as possible e.g.
class Null { constant is_null = 1; int _encode() { return 0; } void _decode(int zero) { }
That results in something distinguishable, but it requires (IMHO clumsy) special handling to process right and does not go down well with existing code.
The properties of my proposed SqlNULL type allow it to be used almost without thinking in existing code, and only if you really want to detect the NULL, you are able to.
The reason I'd like to keep it mostly transparent is because it more closely matches SQL-semantics. I.e. SQL allows you to arbitrarily use NULL values in all expressions and does something "sane" (depending on your viewpoint, of course; at least it's well-defined according to the SQL-ANSI standard) with it. If you create an object for it that doesn't allow even the most basic of operations on it, it will stick out like a sore thumb anytime you need to cater for it.