title: How do I read until the end of file?
body: <p>In C, I can read an input and stop the program when it reaches the end of file (<code>EOF</code>). Like so.</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  
  int main(void) {
      int a;       
      while (scanf("%d", &amp;a) != EOF)
          printf("%d\n", a);
      return 0;
  }
  </code></pre>
  
  <p>How can I do that in Lua?</p>