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

REPL doesn't add the first line to the history

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: Scala 2.9.1
    • Fix Version/s: Scala 2.10.1
    • Component/s: Repl / Interpreter
    • Labels:
    • Environment:

      Scala version 2.10.0.r0-b20110601223329 (Java HotSpot(TM) 64-Bit Server VM, Java 1.6.0_23)

      Description

      REPL is not adding the first line to history:

      Welcome to Scala version 2.10.0.r0-b20110601223329 (Java HotSpot(TM) 64-Bit Server VM, Java 1.6.0_23).
      Type in expressions to have them evaluated.
      Type :help for more information.
      
      scala> 1
      res0: Int = 1
      
      scala> 2
      res1: Int = 2
      
      scala> :history
      1380  for (Regex.Groups(url) <- hrefs) yield url
      1381  Source.fromURL
      1382  import scala.io.Source
      1383  import scala.util.matching.Regex
      1384  import scala.util.matching.Regex._
      1385  val hrefRegex = new Regex("""\<a.*?href=\"(http:.*?)\".*?\>.*?\</a>""") // no semi-colons
      1386  def linksFromUrl(sourceUrl:String) : List[String] = try {  // don't use { } for single-statement methods -- the original was { try { } catch { }
       }
      1387       val source = Source fromURL sourceUrl                  // infix notation for infix methods
      1388       val hrefs = hrefRegex findAllIn source.mkString       // don't convert from Iterator to List prematurely, for performance reasons
      1389       val urls = for (Groups(url) <-hrefs matchData ) yield url          // as described before
      1390       urls.toList                                                            // change to list before returning
      1391   } catch {
      1392       case _ => Nil
      1393   }
      1394  1
      1395  2
      1396  :history
      1397  exit
      1398  2
      1399  :history
      

        Activity

        Hide
        Daniel Sobral added a comment -

        I don't see this issue anymore on trunk. Should it be closed, or does it appear under certain circumstances?

        Show
        Daniel Sobral added a comment - I don't see this issue anymore on trunk. Should it be closed, or does it appear under certain circumstances?
        Hide
        Paul Phillips added a comment -

        Definitely still happens. It's timing dependent, you have to enter it during a short window right after it starts.

        Show
        Paul Phillips added a comment - Definitely still happens. It's timing dependent, you have to enter it during a short window right after it starts.
        Hide
        Adriaan Moors added a comment -

        This is definitely major, but I wouldn't call it a release-stopper.

        Show
        Adriaan Moors added a comment - This is definitely major, but I wouldn't call it a release-stopper.
        Show
        James Iry added a comment - https://github.com/scala/scala/pull/2046

          People

          • Assignee:
            James Iry
            Reporter:
            Daniel Sobral
          • Votes:
            1 Vote for this issue
            Watchers:
            7 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development