Martin Nilsson (Opera Mini - AFK!) @ Pike (-) developers forum wrote:
>2. 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.
-- 
Sincerely,
           Stephen R. van den Berg.

"If you try to fail and succeed, which have you done?"
  • NULL result... Stephen R. van den Berg
    • Re: NU... Martin Bähr
      • Re... Stephen R. van den Berg
    • NULL r... Martin Nilsson (Opera Mini - AFK!) @ Pike (-) developers forum
      • Re... Stephen R. van den Berg
    • NULL r... Martin Stjernholm, Roxen IS @ Pike developers forum
      • Re... Stephen R. van den Berg
        • ... Martin Stjernholm, Roxen IS @ Pike developers forum
          • ... Stephen R. van den Berg
            • ... Martin Nilsson (Opera Mini - AFK!) @ Pike (-) developers forum
              • ... Stephen R. van den Berg

Reply via email to