Scala Programming Language
  1. Scala Programming Language
  2. SI-7081

Make it possible seeing REPL definitions from toolbox parser

    Details

    • Type: Improvement Improvement
    • Status: Open
    • Priority: Minor Minor
    • Resolution: Unresolved
    • Affects Version/s: Scala 2.10.0
    • Fix Version/s: None
    • Component/s: Repl / Interpreter
    • Labels:
      None

      Description

      When using the toolbox parser from REPL, one cannot get parsed code to see REPL definitions because of the way they are wrapped on objects.

      It would be useful to be able to get around that.

        Activity

        Hide
        Eugene Burmako added a comment -
        Show
        Eugene Burmako added a comment - Btw when trying out my code beware of the WAT?!: http://groups.google.com/group/scala-internals/browse_thread/thread/c1d1815ae3f6378e
        Hide
        Daniel Sobral added a comment - - edited

        What's the cast you did on interpreter to get global.afterPhase? Here it says that:

        scala> interpreter.definedSymbolList foreach (sym => println(interpreter.global.afterPhase(interpreter.global.currentRun.typerPhase)(sym.fullName)))
        <console>:15: error: value afterPhase is not a member of scala.tools.nsc.Global
                      interpreter.definedSymbolList foreach (sym => println(interpreter.global.afterPhase(interpreter.global.currentRun.typerPhase)(sym.fullName)))
                                                                                              ^
        
        Show
        Daniel Sobral added a comment - - edited What's the cast you did on interpreter to get global.afterPhase ? Here it says that: scala> interpreter.definedSymbolList foreach (sym => println(interpreter.global.afterPhase(interpreter.global.currentRun.typerPhase)(sym.fullName))) <console>:15: error: value afterPhase is not a member of scala.tools.nsc.Global interpreter.definedSymbolList foreach (sym => println(interpreter.global.afterPhase(interpreter.global.currentRun.typerPhase)(sym.fullName))) ^
        Hide
        Eugene Burmako added a comment - - edited

        Strange. This shouldn't require any casts as in https://github.com/scala/scala/blob/v2.10.0/src/reflect/scala/reflect/internal/SymbolTable.scala#L210. What version of scala do you use?

        Show
        Eugene Burmako added a comment - - edited Strange. This shouldn't require any casts as in https://github.com/scala/scala/blob/v2.10.0/src/reflect/scala/reflect/internal/SymbolTable.scala#L210 . What version of scala do you use?
        Hide
        Daniel Sobral added a comment -

        76f167, I think. A master from February 13th.

        Show
        Daniel Sobral added a comment - 76f167, I think. A master from February 13th.
        Hide
        A. P. Marki added a comment -

        Use exitingPhase now, apparently.

        Show
        A. P. Marki added a comment - Use exitingPhase now, apparently.

          People

          • Assignee:
            A. P. Marki
            Reporter:
            Daniel Sobral
          • Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:

              Development