LiveScript icon indicating copy to clipboard operation
LiveScript copied to clipboard

Please document `global import require 'prelude-ls'`

Open rrthomas opened this issue 9 years ago • 4 comments

I just had a play with LiveScript to show someone learning JavaScript how much more elegantly they could be coding!

It's great, but one thing frustrated me immensely: it took me about half an hour to work out the above incantation to import the entire prelude.

Given that it's so powerful (arguably a large part of the reason to use LiveScript in the first place), could you please foreground the above in the documentation, so users can start playing with LiveScript and its awesome prelude on their own machines as easily as they can in the online web sandbox?

rrthomas avatar May 15 '16 20:05 rrthomas

You can use the -d or --prelude flag when starting the REPL - this is documented with lsc --help

gkz avatar May 15 '16 21:05 gkz

Thanks for responding. Sorry, I wasn't clear: I was talking about running scripts, not using the REPL.

I found -d quickly, but of course it doesn't work with scripts (as far as I could tell from searching, it used to, but now only works with the REPL, which I also found puzzling).

rrthomas avatar May 16 '16 08:05 rrthomas

Huh, I always just do:

global <<< require \prelude-ls

naturalethic avatar May 16 '16 17:05 naturalethic

@naturalethic, exactly! If that were documented obviously and explicitly (rather than having to piece together the fact the -d doesn't work for scripts, that the prelude isn't automatically included in LiveScript, and the syntax you mention above), that would be a great help for those new to Prelude & LiveScript.

rrthomas avatar May 16 '16 19:05 rrthomas