Uploaded image for project: 'Suggestions'
  1. Suggestions
  2. SUGGEST-30

String in REPL result should be consistently quoted

    Details

    • Type: Suggestion
    • Status: CLOSED
    • Priority: Blocker
    • Resolution: Duplicate
    • Labels:
      None
    • Environment:

      Windows 7 Professional
      Scala version 2.10.2 (Java HotSpot(TM) Client VM, Java 1.7.0_25).

      Description

      In Scala REPL (interactive interpreter), type this:

      scala> Set(1, "1.2")
      res11: scala.collection.immutable.Set[Any] = Set(1, 1.2)

      The result does not put a quote on "1.2". Then the user cannot easily see what type each member is in the set. In addition, for the following:

      scala> Set(1, "1.2 ")
      res15: scala.collection.immutable.Set[Any] = Set(1, "1.2 ")

      Quotes are added for string with leading/trailing whitespaces. This adds inconsistency. Also considering the following:

      scala> Set(1, "1.2, 55")
      res18: scala.collection.immutable.Set[Any] = Set(1, 1.2, 55)

      Isn't the result confusing?

      Please consider always adding quotes on strings in REPL result. Thank you.

      PS: Original google group post for this issue is here:
      https://groups.google.com/forum/#!topic/scala-user/xiXpEsCtnoA

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                wrn.lynn Warren Lynn
              • Votes:
                5 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: