Is it possible to use Scala importwithout specifying the main function in the object and without using a keyword packagein the source file with the code that you want to import?
Some explanation: in Python, I can define some functions in some kind of "Lib.py" file, write
from Lib import *
in some other “Run.py” file in the same directory, use the functions from Lib to Run, and then run Run with the command python Run.py. This workflow is perfect for small scripts that I could write in an hour.
In Scala, it seems that if I want to include functions from another file, I need to start wrapping things in extra objects. I would rather not do this.
source
share