title: Lazy readonly property in Swift
body: <p>While playing a little bit with Swift I tried to write a readonly and lazy initialized property. I quickly wrote that line of code just to learn that it's not allowed.</p>
  
  <pre><code>// no valid Swift code.
  lazy let foo : Int = { return 42 }()
  </code></pre>
  
  <p>You have to declare lazy properties as <code>var</code>.
  The swift book clearly states that let with lazy is not possible for a good reason:</p>
  
  <blockquote>
    <p>“You must always declare a lazy property as a variable (with the var keyword), because its initial value might not be retrieved until after instance initialization completes. Constant properties must always have a value <em>before</em> initialization completes, and therefore cannot be declared as lazy.”</p>
  </blockquote>
  
  <p>Supposing I would like to have a readonly lazy property in swift. What's the best way to archive that?</p>