All Questions
16 questions
0
votes
0
answers
41
views
Update value printed to console
I'm attempting to update a value printed to the console in order to implement a simple REPL that supports predictive commands.
So after "->" is printed to the screen using
Console.print(&...
0
votes
1
answer
489
views
Running Scala function from command line
I'm working on an exercise. I need to create a java project that can be run from the scala command line. The final output should be this:
scala> int2str(6)
res0: String = six
scala> int2str(65)
...
0
votes
1
answer
185
views
gradle REPL in java8 for scala development
Is there a way to retrofit java8 with a REPL in gradle similar to sbt console which automatically adds the classes of the project to the class path of the REPL? https://plugins.gradle.org/plugin/net....
0
votes
1
answer
273
views
how to call scala REPL console from scala program?
I need embed Scala REPL functionality in my Scala Application. How can I do that ? Which Scala method/class I need to call ?
I take a look at scala.tools.nsc.interpreter package but I don't see how ...
1
vote
0
answers
431
views
Scala - REPL - non-ASCII characters
This question is about the Scala REPL.
If I enter a non-ASCII char e.g. π, I only see ? in the REPL console.
So it does not display the non-ASCII chars properly.
I tried the solutions suggested ...
4
votes
0
answers
314
views
Saving all results in Scala REPL
Is there an easy way to save all the values of variables in scala REPL?
There is :save command in scala but it just saves the history of commands and the next time we need to recalculate everything ...
2
votes
0
answers
843
views
How to make a REPL?
I am working on the REPL for a custom programming language on the JVM. The REPL currently has the ability to read a line and convert it to an AST, using the exact same parsers and AST structures as ...
1
vote
2
answers
479
views
Why doesn't Java have a REPL? [closed]
I was wondering why Java doesn't have a REPL. Is there some technical limitation? As an aside, how do REPLs actually work, what's going on with say the Scala REPL?
59
votes
4
answers
33k
views
Scala repl throws error
When I type scala on the terminal to start the repl, it throws this error
scala> [init] error: error while loading AnnotatedElement,
class file '/usr/lib/jvm/java-8-oracle/jre/lib/rt.jar
(java/...
2
votes
0
answers
156
views
Run Scala REPL via Java ProcessBuilder
For research reasons I want to be able to call the Scala REPL in my Java code. To do so I use Java's ProcessBuilder and call the command scala. Although the code nicely returns the welcome message of ...
6
votes
2
answers
3k
views
Unicode Regex in Scala REPL
I want to detect words of Unicode Letters (\p{L}).
Scala's REPL gives back false for the following statement, while in Java it's true (which is the right behaviour):
java.util.regex.Pattern.compile("...
1
vote
0
answers
88
views
How can I type in a class in scala and send it to a remote end?
I have an interface called CodeInterface on a remote server (running Java). What I wanna do now is to manually type-in a class implementing CodeInterface in scala REPL, send it to the remote server, ...
6
votes
2
answers
1k
views
Techniques to add a REPL to a Java project
What techniques that people have found useful using Clojure, Scala, JRuby, build tools, etc. to retrofit a Java project with a REPL to quickly experiment?
I often need to work with plain old Java ...
2
votes
2
answers
502
views
Any way to get a BeanShell (or Scala, or JRuby) REPL in a pure Java Maven2 project?
I have a Java only project using Maven2. It'd be very useful to be able to get a REPL that has access to the full classpath of the compiled application and all libraries. In SBT, this is trivial for ...
27
votes
4
answers
5k
views
Attach a clojure / scala repl to a running JVM
I have a java web application running under tomcat in a Sun java 6 JVM. Is there a way to attach a scala or clojure REPL to the running JVM ?
Once the webapp is up and running, the context in which ...