</code></pre></td><tdclass="code"><divclass="highlight"><pre></pre></div></td></tr><trid="section-2"><tdclass="docs"><divclass="octowrap"><aclass="octothorpe"href="#section-2">#</a></div><p>Require the <strong>coffee-script</strong> module to get access to the compiler.</p></td><tdclass="code"><divclass="highlight"><pre><spanclass="nv">CoffeeScript: </span><spanclass="nx">require</span><spanclass="s1">'coffee-script'</span></pre></div></td></tr><trid="section-3"><tdclass="docs"><divclass="octowrap"><aclass="octothorpe"href="#section-3">#</a></div><p>Our prompt.</p></td><tdclass="code"><divclass="highlight"><pre><spanclass="nv">prompt: </span><spanclass="s1">'coffee>'</span></pre></div></td></tr><trid="section-4"><tdclass="docs"><divclass="octowrap"><aclass="octothorpe"href="#section-4">#</a></div><p>Quick alias for quitting the REPL.</p></td><tdclass="code"><divclass="highlight"><pre><spanclass="nx">process</span><spanclass="p">.</span><spanclass="nx">mixin</span><spanclass="p">{</span>
<spanclass="p">}</span></pre></div></td></tr><trid="section-5"><tdclass="docs"><divclass="octowrap"><aclass="octothorpe"href="#section-5">#</a></div><p>The main REPL function. <strong>run</strong> is called every time a line of code is entered.
Attempt to evaluate the command. If there's an exception, print it out instead
of exiting.</p></td><tdclass="code"><divclass="highlight"><pre><spanclass="nv">run: </span><spanclass="p">(</span><spanclass="nx">code</span><spanclass="p">)</span><spanclass="o">-></span>
<spanclass="nx">print</span><spanclass="nx">prompt</span></pre></div></td></tr><trid="section-6"><tdclass="docs"><divclass="octowrap"><aclass="octothorpe"href="#section-6">#</a></div><p>Start up the REPL by opening <strong>stdio</strong> and listening for input.</p></td><tdclass="code"><divclass="highlight"><pre><spanclass="nx">process</span><spanclass="p">.</span><spanclass="nx">stdio</span><spanclass="p">.</span><spanclass="nx">addListener</span><spanclass="s1">'data'</span><spanclass="p">,</span><spanclass="nx">run</span>