title: Why does show() behave inconsistently in Julia?
body: <p>I have inconsistent behaviour from <code>show</code> in Julia, depending if it is called explicitly or from the REPL. What is the <strong>one</strong> method I can overload such that I always see the same output?</p>
  
  <p>Specifically, I am defining a new type:</p>
  
  <pre><code>immutable Rigid3D{T&lt;:Real}
      rotation::ImmutableArrays.Matrix3x3{T}
      translation::ImmutableArrays.Vector3{T}
  end
  </code></pre>
  
  <p>with a show function:</p>
  
  <pre><code>import Base.show
  
  function show{T}(io::IO,trans::Rigid3D{T})
      println(io,typeof(trans))
      println(io,"- rotation:")
      println(io,trans.rotation)
      println(io,"- translation:")
      print(io,trans.translation)
  end
  </code></pre>
  
  <p>When the REPL displays my function I get a certain type of output for the rotation matrix which looks like</p>
  
  <pre><code>RigidTransforms.Rigid3D{Float64}
  - rotation:
  3x3 ImmutableArrays.Matrix3x3{Float64}:
   1.0  0.0  0.0
   0.0  1.0  0.0
   0.0  0.0  1.0
  - translation:
  [0.0,0.0,0.0]
  </code></pre>
  
  <p>while I get what I actually want by explictly calling <code>show</code> or <code>print</code> or similar:</p>
  
  <pre><code>RigidTransforms.Rigid3D{Float64}
  - rotation:
  [1.0 0.0 0.0
   0.0 1.0 0.0
   0.0 0.0 1.0]
  - translation:
  [0.0,0.0,0.0]
  </code></pre>