Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

In REPL, codes cannot have multiple lines #345

Closed
UlyssesZh opened this issue Apr 13, 2020 · 4 comments
Closed

In REPL, codes cannot have multiple lines #345

UlyssesZh opened this issue Apr 13, 2020 · 4 comments

Comments

@UlyssesZh
Copy link
Contributor

It is really limiting the existence of complicated lisp codes in alda repl codes.

@daveyarwood
Copy link
Member

Some sort of multi-line editing would make the REPL experience better, for sure.

It seems like it might be a bit tricky to implement. I would probably want the parser to return some kind of error code to indicate when there is a parse error where we reached EOF unexpectedly, and then respond to that error code in the REPL by going down to the next line and continuing to accept input. Then this process could continue each time the user presses Enter -- either the code would be submitted successfully or we would go down to the next line.

It looks like multi-line reading is supported in JLine 3, so we could leverage that, although it would require an upgrade from JLine 2 which we're currently using.

I'm in the middle of a ground-up rewrite of the client in Go, so I'll explore options there when I get to reimplementing the REPL.

In the meantime, adding multi-line support to the existing Java client would be a welcome contribution, if anyone wants to tackle it!

@UlyssesZh
Copy link
Contributor Author

Maybe it can be taken that: if the last character of the line is a backslash, let the repl parser continue to the next line.

@daveyarwood
Copy link
Member

That's another possibility. And another option is to provide a separate mapping like Ctrl-Enter that goes down to the next line instead of submitting.

@daveyarwood daveyarwood transferred this issue from alda-lang/alda-client-java Jan 1, 2021
@xcoderreal
Copy link

I am new to alda-lang and I was about to report the same feature request.

I feel that having this support will allow much quicker iterations for coder/musicians. (Otherwise we will be forced to first save code snippet to experiment to a file, then run ./alda play -f to run; which works, but defeats the purpose of having a CLI.)

Some approaches to implementing (potentially relatively easily) this that came to my mind:

@alda-lang alda-lang locked and limited conversation to collaborators Oct 7, 2022
@daveyarwood daveyarwood converted this issue into discussion #446 Oct 7, 2022

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Projects
None yet
Development

No branches or pull requests

3 participants