title: Pass an optional boolean variable
body: <p>Sometimes we want an optional parameter</p>
  
  <pre><code>function doSomething(foo:Integer; bar:TObject=nil)
  begin
      if bar &lt;&gt; nil then // do something optional with bar
      ....
  end
  </code></pre>
  
  <p>How do I do the equivalent with a boolean, that allows me to differentiate between the two boolean values and "no value"?</p>
  
  <pre><code>function doSomething(foo:Integer; bar:Boolean=nil) // Won't compile
  begin
      if bar &lt;&gt; nil then // do something optional with bar
  end
  </code></pre>
  
  <p>Obviously this won't compile as a Boolean cannot be nil.</p>
  
  <p>Basically, I want a parameter with three possible states; true, false or "unspecified".</p>