LiveScript icon indicating copy to clipboard operation
LiveScript copied to clipboard

Feature request: REPL commands

Open bmundt6 opened this issue 5 years ago • 2 comments

Node allows the use of dot-first keywords as commands in the REPL, such as .load script.js: https://nodejs.org/api/repl.html#repl_commands_and_special_keys

It would be nice to have functions implementing each of the commands for use in the repl - they don't actually need to use special syntax, since LiveScript already has command-like syntax for functions (e.g. could have a simple function load = (filename) -> ...).

bmundt6 avatar Dec 04 '19 16:12 bmundt6

LiveScript's REPL only uses the Node.js REPL for tab completion; the actual interface you interact with is a custom Readline frontend backed by the vm module. So any commands you want would have to be implemented from scratch.

Are there any that would be especially useful to you? The LS REPL already has a few special functions exposed; I'm not fundamentally opposed to adding more, but some of those commands look like they'd be tricky to reproduce faithfully.

rhendric avatar Dec 04 '19 17:12 rhendric

The main two that I use are .load and .save. .help and .clear are also very useful but not as much to me.

bmundt6 avatar Dec 04 '19 17:12 bmundt6