title: Three valued logic in Delphi
body: <p>How to best implement a <a href="http://en.wikipedia.org/wiki/Three-valued_logic">three valued logic</a> in Delphi?</p>
  
  <p>I was thinking of</p>
  
  <pre><code>type
    TExtBoolean = (ebTrue, ebFalse, ebUnknown);
  </code></pre>
  
  <p>with</p>
  
  <pre><code>function ExtOr(A: TExtBoolean; B: TExtBoolean): TExtBoolean;
  begin
    if (A = ebTrue) or (B = ebTrue) then
      Result := ebTrue
    else if (A = ebFalse) and (B = ebFalse) then
      Result := ebFalse
    else
      Result := ebUnknown;
  end;
  </code></pre>
  
  <p>and so on.</p>
  
  <p>But that does not seem to be very elegant. Does a better way exist?</p>
  
  <p><strong>Edit:</strong> With elegance I mean easy to use. The more elegant the implementation, the better. CPU-efficiency is not (that) important for me.</p>