Skip to content
This repository has been archived by the owner on Aug 23, 2018. It is now read-only.

Can't paste multi-line code into REPL #141

Open
ghost opened this issue Nov 25, 2016 · 5 comments
Open

Can't paste multi-line code into REPL #141

ghost opened this issue Nov 25, 2016 · 5 comments

Comments

@ghost
Copy link

ghost commented Nov 25, 2016

I'd like to copy and paste this code into the REPL:

narrowDown input output functions =
  let
    tester input output function =
      -- (function input) == output
      function input == output
  in
    List.filter (tester input output) functions

But when I do each line is executed individually so there are lots of syntax errors.

@process-bot
Copy link

Thanks for the issue! Make sure it satisfies this checklist. My human colleagues will appreciate it!

Here is what to expect next, and if anyone wants to comment, keep these things in mind.

@kkruups
Copy link

kkruups commented Dec 6, 2016

Hi Will,

You need to add backslash, \ , at the end of each line, except the last line, then hit enter, in order to be able to add multi-lines all at once.

Is that what your doing?

You should be able to copy and paste the code as is below and then just hit enter to allow multi-lines in elm-repl. Let me know if this works for you.

narrowDown input output functions =\
  let\
    tester input output function =\
      -- (function input) == output\
      function input == output\
  in\
    List.filter (tester input output) functions


@ghost
Copy link
Author

ghost commented Dec 7, 2016

Sorry, I should have said I know about the backslashes! At least without a tool, it's a chore to have to do that.

@pzp1997
Copy link

pzp1997 commented Apr 15, 2018

For reference, the main Haskell REPL, ghci, handles multiline input like so

  1. Begin a new line with :{
  2. Type in your code. Press enter when you need a new line.
  3. Type :} to end the multi-line input.

Source: https://en.wikibooks.org/wiki/Haskell/Using_GHCi_effectively#Multi-line_Input

@setrar
Copy link

setrar commented Aug 20, 2018

For reference, the main Scala REPL, handles multiline input like so


   1. Begin a new line with :paste
   2. Type in your code (or paste). Press enter when you need a new line.
   3. Type ^D to end the multi-line input.

Source: https://www.scala-lang.org/old/node/10571.html

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants