How can I generate this output with CoffeScript?
(function(doc) {})(document);
((doc) ->
)(document)
will generate
(function(doc) {})(document);
If you're asking in the context of wrapping something in a closure - for instance a JQuery plugin - this will not be needed. See this question