'Cannot use :paste in Scala 3.0.0 REPL

In Scala 2.x I use :paste for multi-line pasting. I am using Scala 3.0.0 and using the same approach throws an error:

scala> :paste
Unknown command: ":paste", run ":help" for a list of commands

I tried the following but I don't know how to execute when I'm done writing the code:

scala> if (true)
     |   println("that was true")
     | else
     |   print("false")
     |

I found at https://users.scala-lang.org/t/solved-cannot-use-paste-in-scala3-repl/7587 that

:paste is not implemented but it’s also not really needed because multi-line pasting is supported by the scala 3 REPL.

How do I execute the multi-line code in Scala 3?

UPDATE 1:

I achieved it by using

scala> if (true)
     |   println("that was true")
     | else
     |   print("false")
     | ;
that was true

Is there another way to execute the multi-line code, without having to write ;?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source