Support `using` directives straight from the REPL
See original GitHub issueScala CLI version: 0.1.17 Scala version (default): 3.2.0
Using the following script
//> using lib "com.lihaoyi::os-lib:0.7.8"
//> using lib "org.typelevel::cats-effect:3.4.1"
import os._
import cats.implicits._
println("toto")
when running
> scala-cli script.sc
Downloading 3 dependencies
Compiling project (Scala 3.2.0, JVM)
Compiled project (Scala 3.2.0, JVM)
toto
Which is ok.
But when doing the same thing in the REPL it’s like if the using directive was not used.
> scala-cli
Welcome to Scala 3.2.0 (11.0.16, Java OpenJDK 64-Bit Server VM).
Type in expressions for evaluation. Or try :help.
scala> //> using lib "com.lihaoyi::os-lib:0.7.8"
scala> //> using lib "org.typelevel::cats-effect:3.4.1"
scala> import os._
-- [E006] Not Found Error: -----------------------------------------------------
1 |import os._
| ^^
| Not found: os
|
| longer explanation available when compiling with `-explain`
1 error found
when using --amm
I have same issue, except os-lib which is imported by default.
I would have expected the script to the same way in REPL than from a file. So I could try in REPL what is in my script.
Issue Analytics
- State:
- Created 10 months ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
Chapter 12 The toplevel system or REPL (ocaml)
These directives control the behavior of the toplevel; they are listed below in section 12.2. Unix: The toplevel system is started by the...
Read more >F# Interactive (dotnet) Reference - Microsoft Learn
Learn how F# Interactive (dotnet fsi) is used to run F# code interactively at the console or to execute F# scripts.
Read more >Node.js environment: REPL - Lost-in-Code
The REPL comes with every Node.js installation and helps to conduct quick tests and explore JavaScript code in the Node environment without ...
Read more >@programmeruser idk just add... - Replit
I have no idea how Microsoft Visual C++ works so I can't help you with that. After that you will want to run...
Read more >How to launch a C# REPL or interactive compiler in Visual ...
We can load an assembly and call its methods using the #r command, which has important features like resetting the environment, clearing the...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
re-tagging this as a
wontfix
feature request. it doesn’t seem we’ll be able to support this until Scala REPL/Ammonite REPL addusing
directive support.Closing this for the time being, since there’s not much to be done about it on our side for now.