title: Understanding recursion without base case in Julia
body: <p>This snippet is from the implementation of <a href="https://github.com/JuliaLang/julia/blob/master/base/rational.jl">Rational Numbers</a> in Julia:</p>
  
  <pre><code># Rational.jl
  # ...
  Rational{T&lt;:Integer}(n::T, d::T) = Rational{T}(n,d)
  Rational(n::Integer, d::Integer) = Rational(promote(n,d)...)
  Rational(n::Integer) = Rational(n,one(n))
  
  //(x::Rational, y::Integer) = x.num // (x.den*y) &lt;--- HERE!
  
  # ...
  </code></pre>
  
  <p>See how the <code>//</code> function is implemented and then used with infix notation? How does this actually return a value?</p>
  
  <p>When I saw this code I interpreted it like this:</p>
  
  <ol>
  <li>The <code>//</code> function is called with a Rational and an Integer.</li>
  <li>But then it makes a recursive call with no other arguments.</li>
  </ol>
  
  <p>#2 is the one that really confuses me. Where does the recursion within data structure end? How does <code>//</code> return a value if it is constantly evaluating nothing?</p>
  
  <p>Please help me understand this.</p>