title: Reopening class and adding instance variables
body: <p>I am teaching myself Crystal-lang and I came across a section in the documentation that I don't quite understand.</p>
  
  <p><a href="https://crystal-lang.org/reference/syntax_and_semantics/methods_and_instance_variables.html" rel="nofollow noreferrer">Here</a> is the documetation page.</p>
  
  <p>On that page it gives the following code:</p>
  
  <pre><code>class Person
    @age = 0
  
    def initialize(@name : String)
    end
  end
  </code></pre>
  
  <p>This is followed by the following statement:</p>
  
  <blockquote>
    <p>This will initialize @age to zero in every constructor. <strong>This is useful to avoid duplication, but also to avoid the Nil type when reopening a class and adding instance variables to it.</strong></p>
  </blockquote>
  
  <p>Can someone please explain, or show me an example of the bolded behaviour? I'm not certain I understand what it means by "reopening a class and adding an instance variable to it".</p>