title: Access Delphi record fields via . or ^
body: <p>I came across something in the Delphi language that I hadn't noticed before. Consider a simple record and a pointer to that record:</p>
  
  <pre><code>TRecord = record
       value : double;
  end;
  PTRecord = ^TRecord;
  </code></pre>
  
  <p>Now declare a variable of type PTRecord:</p>
  
  <pre><code>var x : PTRecord;
  </code></pre>
  
  <p>and create some space:</p>
  
  <pre><code>x := new (PTRecord);
  </code></pre>
  
  <p>I noticed that I can access the value field using both the '.' notation and the '^.' notation. Thus the following two lines appear to be operationally equivalent, the compiler doesn't complain and runtime works fine:</p>
  
  <pre><code>x.value := 4.5;
  x^.value := 2.3;
  </code></pre>
  
  <p>I would have thought that '^.' is the correct and only way to access value? My question is, is it ok to use the simpler dot notation or will I run into trouble if I don't use the pointer indirection '^.'? Perhaps this is well known behavior but it's the first time I've come across it. </p>