title: Very confused about fields in F# and their access rules as well as initialization
body: <p>Let's take this class:</p>
  
  <pre><code>type Test() =
  
      let mutable Flag1 : bool = false
      [&lt;DefaultValue&gt;] val mutable Flag2 : bool
  
      do
          Flag1 &lt;- true  // that works
          Flag2 &lt;- true  // nope... why?
  
      member this.SetFlag =
          Flag1 &lt;- true  // no 'this' instance? does that mean it's static?
          this.Flag2 &lt;- true  // that works now, but still no way to set a default value
  </code></pre>
  
  <p>Why do I need <code>[&lt;DefaultValue&gt;]</code> when I want to be able to set the value to whatever myself?</p>
  
  <p>and then now:</p>
  
  <pre><code>type Test2() =
      Inherit(Test)
  
      do
          Flag1 &lt;- true  // not accessible
          Flag2 &lt;- true  // not happening either
  
      member this.SetFlag2 =
          Flag1 &lt;- true  // not accessible
          this.Flag2 &lt;- true  // ok
  </code></pre>
  
  <p>so I could do:</p>
  
  <pre><code>    member val Flag1 : bool with get, set
  </code></pre>
  
  <p>but why isn't the syntax <em>val this.Flag1</em> since it's part of the instance?
  and.. I can't access that from the constructor.</p>
  
  <p>Can anyone explain how this works? because it's very confusing.
  It looks like the usefulness of constructors is quite low if you can't set things in there. Or, am I missing something?
  And I can't construct an instance of the class and set variables though a new() constructor since the last statement needs to return the instance, so I can't create an instance, set everything I need and then return it. Or, is it possible?</p>
  
  <p>Also, how can I have a field that:</p>
  
  <ul>
  <li>Is an instance field, not static</li>
  <li>I can initialize to whatever I want in the constructor</li>
  <li>Is mutable</li>
  <li>Is accessible from member functions</li>
  </ul>
  
  <p>like a plain field in C# in essence.</p>
  
  <p>What I am trying to implement is:
  I need to have a timer object that belongs to the class instance and can be initialized in the constructor. Class methods need to have access to the timer and the timer's callback needs to have access to class fields.</p>
  
  <p>In pseudo C#, I'd have something like this:</p>
  
  <pre><code>Class A
  {
      public Timer MyTimer;
      public bool Flag1, Flag2;
  
      A()
      {
          MyTimer = new Timer(Callback);
      }
  
      public void StartTimer()
      {
          MyTimer.Start();
      }
  
      public void Callback()
      {
          if (Flag1) Flag2 = true;
      }
  }
  
  public class B : A
  {
      public void DoStuff()
      {
          Flag1 = True;
      }
  }
  </code></pre>