Skip to content
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

Ammonite imports don't work in REPL #120

Closed
odisseus opened this issue Sep 7, 2021 · 3 comments · Fixed by #1787
Closed

Ammonite imports don't work in REPL #120

odisseus opened this issue Sep 7, 2021 · 3 comments · Fixed by #1787
Labels
enhancement New feature or request UX

Comments

@odisseus
Copy link

odisseus commented Sep 7, 2021

$ cat abc.sc 
import $ivy.`org.scalaz::scalaz-core:7.3.5`, scalaz._, Scalaz._
val x = (Option(1) |@| Option(2))(_ + _)
println(x)
$ scala-cli -S 2.12 abc.sc 
Some(3)
$ scala-cli repl -S 2.12
Welcome to Scala 2.12.14 (OpenJDK 64-Bit Server VM, Java 11.0.11).
Type in expressions for evaluation. Or try :help.

scala> import $ivy.`org.scalaz::scalaz-core:7.3.5`
<console>:11: error: not found: value $ivy
       import $ivy.`org.scalaz::scalaz-core:7.3.5`
$ scala-cli about
Scala CLI version 0.0.1 (v0.0.1)
@romanowski romanowski added enhancement New feature or request UX labels Dec 24, 2021
@romanowski
Copy link
Member

@alexarchambault @lwronski I spoke with @odisseus and he is missing the ability to dynamically load a library inside repl without dropping state in the memory (if that is possible). We need to discuss where this issues fits in our plans.

@DrGrognon
Copy link

For what it's worth (maybe it's obvious ^^) I tried using

$ scala-cli repl --amm
@ import $ivy.`org.scalaz::scalaz-core:7.3.5`

Worked like a charm ! So mixing repl you got the better of each world 😆

@MaciejG604 MaciejG604 linked a pull request Jan 18, 2023 that will close this issue
@MaciejG604
Copy link
Contributor

Support for $ivy and $dep ammonite imports has been removed. (See #1678) So this issue doesn't apply anymore.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request UX
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants