Ask coding questions

← Back to all posts
Why REPL on link ended with "This repl has exited, run again?"
coalesce (1)

Hi! Please clarify how to use this mistery link in each repl?
When I press "Open in a new tab" it opens REPL in new browser tab as I expected. But then just started to run my project and then end with "This repl has exited, run again?".
But I expect to stay in that REPL as it is normally done in REPL languages (Clojure, Node, Python etc). Is there a way for such behaviour?

Answered by timmy_i_chen (1036) [earned 5 cycles]
View Answer
timmy_i_chen (1036)

The new tab (repl run) is for execution only, no REPL there. :)

PYer (2682) does this automatically. You could cause it to not end and just print: 'This repl has finished normall, run again? [y]:' and ask for their input. Then you could rerun your code. If you want me to send an example tell me.

If this was helpfull, please mark as answer to question or upvote thanks!

coalesce (1)

@PYer If you saying about something like

(println "Enter something> ")
(def x (read-line))
(println (str "You typed \"" x "\""))

Then I thought about something else. I thought that this link will open connection to the very same REPL from my project's main window. So that that new browser tab could allow to work in the same REPL context.
But seems it's not the case

PYer (2682)

@coalesce i don't understand what you are saying. are you asking a question?

Zavexeon (878)

Well, the repl will "exit" if it gets to the last line of code. That's just because it's done doing everything you've asked it to do.

Simply click the "run again" button if you want to rerun the program from the top.

If you want to keep a program from terminating then consider using some kind of loop.

coalesce (1)

@Zavexeon Then this stuff shoud be named different :) because last L in repl IS loop