Coder Social home page Coder Social logo

Comments (5)

haifenghuang avatar haifenghuang commented on July 29, 2024

The REPL already support multi-line support for code blocks if you end a line with a ''. But as you might think, it's very inconvenience. so I've improved the REPL according to your suggestion.

from magpie.

 avatar commented on July 29, 2024

@haifenghuang Thank you.

Is it possible to do something like this

magpie>> println(
... "hi"
... )
hi
magpie>>

instead of

magpie>> println(
... "hi"
... )
... 
hi
magpie>>

?

I mean something like in python REPL (support for empty lines and exit multiline mode not after empty line):

Python 2.7.10 (default, Oct  6 2017, 22:29:07) 
[GCC 4.2.1 Compatible Apple LLVM 9.0.0 (clang-900.0.31)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> print(
...
...
...
... "hi"
... )
hi
>>> 

I think it will be more comfortable this way.

from magpie.

haifenghuang avatar haifenghuang commented on July 29, 2024

I just pushed a new commit, now you can do it.

from magpie.

 avatar commented on July 29, 2024

@haifenghuang I think repl can check every line and the line that will not return an error can be a terminator for expression/statement.

from magpie.

haifenghuang avatar haifenghuang commented on July 29, 2024

Yes, you are right. At first, I think it would be very complicated. After think a while, I found a better & simpler way to do it.

from magpie.

Related Issues (17)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.