Oh wow. A CoffeeScript REPL? If it can hook right in to the Narwhal standard library, that'll be quite a thing to see.
Looking briefly at your commits, I'll add a flag to disable the function safety wrapper so that you don't need to strip it off. Thanks for the tusk package -- it's quite a Christmas present.
Indeed it can use all the standard library modules, since the normal "require" functions are available.
The other problem with the REPL is that all variable assignments are prefixed with "var", so they're always local to the function where the eval-ing is done, thus it's impossible to get variables to persist between REPL commands (without explicitly assigning to a property of "global").
One solution would be to add a flag that disables the "var" for top level assignments (but not within functions).
Alternatively, I think I could do some engine-specific black magic (__proto__ hacks), at least for Rhino.
Alright -- this is fixed with the latest commit. I've enhanced the --no-wrap option to not emit "var" declarations at the top level. If you don't want the safety wrapper, then you probably intend to make them global in any case.
bin/cs now works like a charm. I might pull it back into the main bin/coffee-script executable. Start a REPL if run without arguments ... --run for executing CoffeeScripts via Narwhal... something like that.
On second thought, ideally these should be different options. When used in a module we add our own function wrapper but still want the "var"s. In the REPL we don't want the "var"s (making the safety wrapper useless, but harmless)
Looking briefly at your commits, I'll add a flag to disable the function safety wrapper so that you don't need to strip it off. Thanks for the tusk package -- it's quite a Christmas present.