title: How to lock the variable type in Julia?
body: <p>I want to lock the type of a variable in Julia, how to do? For example, I define an array called weight,</p>
  <pre><code>weight = Array{Float64,1}([1,2,3])
  </code></pre>
  <p>Now I want to lock the type of weight as Array{Float64,1}, is it possible?</p>
  <p>I mean if do not lock the type of weight, then if I mistakenly or casually do</p>
  <pre><code>weight = 1
  </code></pre>
  <p>Then weight will become an Int64 variable, so it is not longer a 1D array. This is obviously not what I want.</p>
  <p>I just want to make sure that once I defined weight as 1D Float64 array, then if I change the type of weight, I want Julia gives me an error saying that the type of weight has been changed which is not allowed. Is it possible? Thanks!</p>
  <p>This is useful because by doing this, it may preventing me from forgetting weight is an 1D array, and therefore preventing bugs.</p>