Replies: 3 comments 1 reply
-
That's an interesting issue. I would be clearer for the users if they wouldn't need a special extension. I had a user confused for a while when they were trying to execute |
Beta Was this translation helpful? Give feedback.
-
I have just noticed that what i said about the “current” runner only applies to Scala 2, not Scala 3:
|
Beta Was this translation helpful? Give feedback.
-
Yes, there is an relevant difference between For For @julienrf Are you suggesting that |
Beta Was this translation helpful? Give feedback.
-
As I mentioned in a discussion, there are currently two forms of scripts supported by Scala CLI. The
.sc
scripts are evaluated in a worksheet-like mode, where top-level statements are allowed, whereas the.scala
scripts are evaluated as JVM programs (with a proper main method).It is worth noting that the current
scala
command (based on Scala 2.13) does support both modes in a more “unified” way: regardless of the file extension, if the file defines a proper main method it is executed as a program, otherwise we fall back to a worksheet-like mode.Do you think it would be possible (and desirable) to follow the same approach in Scala CLI? That could also help supporting scripts with no file extension at all (see #466)?
Beta Was this translation helpful? Give feedback.
All reactions