title: CoffeeScript function compilation problems
body: <p>I have CoffeeScript that looks like the following:</p>
  <pre><code>myfunctionname = (foo, bar, baz) -&gt;
      alert(&quot;I am here&quot;)
      return
  </code></pre>
  <p>This is supposed to be the way to declare a function in coffee script. (according to <a href="http://js2coffee.org" rel="nofollow noreferrer">js2coffee.org</a> and others)</p>
  <p>This gets converted into the following:</p>
  <pre><code>(function() {
    var myfunctionname;
  
    myfunctionname = function(foo, bar, baz) {
      alert(&quot;I am here&quot;);
    };
  }).call(this);
  </code></pre>
  <p>The problem with this is that when I try to include this js file into a view and access my <code>myfunctionname</code> method, it does not exist. It is probably out of scope.</p>
  <p>Thus, CoffeeScript does not convert into a usable format for me. I need the following output format:</p>
  <pre><code>function myfunctionname (foo, bar, baz) {
    alert(&quot;I am here&quot;);
  };
  </code></pre>
  <p>This format allows me to include the functions where I need them.</p>
  <p>Is there any way of achieving this in CoffeeScript? Or should I consider dropping CoffeeScript altogether?</p>