You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We need a way to pass a code snippet or Scala source file that'd be run on REPL startup.
This is very similar to Ammonite REPL's (https://github.com/com-lihaoyi/Ammonite or --amm passed to Scala CLI) -c/--code option.
a way to pass a code snippet or source file to the REPL main class to be executed at REPL startup
something like this:
java
-Dscala.usejavacp=true
-classpath (...)
dotty.tools.repl.Main
-classpath (...)
--init-script 'println("Hello from the init script in REPL")'# Welcome to Scala 3.4.2 (17, Java OpenJDK 64-Bit Server VM).# Type in expressions for evaluation. Or try :help.## Hello from the init script in REPL# scala>
a way to skip the interactive mode and execute the script inside of the REPL, similar to what the -e flag does outside of the REPL
this would make testing integrations a lot easier
Ammonite equivalent:
scala-cli repl --power --amm --ammonite-arg -c --ammonite-arg 'println("Hello from the init script in REPL")'# Compiling ~/Downloads/(console)# Hello from the init script in REPL
What needs to be done
We need a way to pass a code snippet or Scala source file that'd be run on REPL startup.
This is very similar to
Ammonite
REPL's (https://github.com/com-lihaoyi/Ammonite or--amm
passed to Scala CLI)-c
/--code
option.Why do we need this?
Requirements
I'd imagine we need:
-e
flag does outside of the REPLContext
Past discussions:
The text was updated successfully, but these errors were encountered: