In the "official" scala REPL I can do
scala> import util.Random
scala> util.Random.nextInt
res0: Int => -306696783
but in Ammonite-REPL I get
@ import util.Random
cmd3.sc:1: object Random is not a member of pack ammonite.util
import util.Random
^
Compilation Failed
So right now I have to use the scala.
prefix to make it work in Ammonite:
@ import scala.util.Random
@ scala.util.Random.nextInt
res1: Int = 503117434
I'm kind of new to Scala so I don't get why would ammonite use a different util
than the (for me) "official" util
, so I would appreciate if anyone can provide a rationale for this.
And more specifically, Is there any way to make util
to be scala.util
instead of ammonite.util
?