SIP-XX: Dedented Multiline String Literals

We have an alternative implementation has now been merged

It’s available as an experimental feature in the nightlies today and will ship first in Scala 3.10.0.
If you are interested in the feature, give it a try and report back here.

2 Likes

What seems to have been implemented is this, am I correct ?

def example =
  def notIndented = '''
  hello
  '''
  def indented = '''
    hello
  '''
  def oldIndented = """
  hello
  """

Where

  • notIndented is "hello"
  • indented is " hello"
  • oldIndented is the same as indented maybe with some extra \n (unchanged, but I don’t remember how it goes)

oldIndented = "\n hello\n "

I have implemented SIP-72 into scala-object-notation 0.4.1, and as an example use case as a config file.

1 Like