Created
September 8, 2010 20:31
-
-
Save razie/570783 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Interpreter(val settings: Settings, out: PrintWriter) { | |
repl => | |
// 1. Request is private. I need: dependencies (usedNames?) newly defined values (boundNames?) | |
// the resulting value and the error message(s) if any | |
case class PublicRequest (usedNames : List[String], valueNames:List[String], extractionValue:Option[Any]) | |
// 2. Can't get the last request | |
def lastRequest : Option[PublicRequest] = | |
prevRequests.lastOption map (l => | |
PublicRequest (l.usedNames.map(_.decode), l.valueNames.map(_.decode), l.extractionValue) | |
) | |
... // the rest of the Interpreter class |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This is a quick "hack" to allow access to the internal class Request of the scala.nsc.tools.Interpreter.scala - this is needed in "advanced" scripting applications.
This does not change the existing logic at all and could easily be added, temporarily, since there's probably no overhaul in sight for these classes...