Uploaded image for project: 'Groovy'
  1. Groovy
  2. GROOVY-6623

Groovysh: improve interpreter_mode likeness

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 2.4.0-beta-1
    • Groovysh
    • None

    Description

      Groovysh looks like an interpreter-REPL, but it really compiles every complete snippet of lines as a script ad runs the compiled scripts. This has the severe usability / learnability issue that unbound variables do not get stored in the running session, i.e.:

      groovy:000> def x = 3
      ===> 3
      groovy:000> x
      Unknown property: x

      The main problems here is that plenty of valid code from books/tutorials will not run unless the declaration is manually removed by users. The same goes for copy&pasting any other Java/Groovy code into the running session, it will break on any variable declarations.

      Based on discussions with user@groovy.codehaus.org and dev@groovy.codehaus.org:
      http://groovy.329449.n5.nabble.com/groovysh-variable-declarations-td5717853.html

      http://groovy.329449.n5.nabble.com/Fwd-groovy-user-groovysh-variable-declarations-td5718024.html

      I want to open this issue on JIRA to track it.

      I have a current prototype implementation that is not pretty but works, with caveats.

      Attachments

        Activity

          People

            pschumacher Pascal Schumacher
            tkruse Thibault Kruse
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: