Import multiple packages in Scala REPL

久未见 提交于 2019-11-29 03:54:00

I'm not sure of a general solution, but in SBT it's possible to configure the project so that the console (REPL) runs some initial commands upon launching. Here's an excerpt from an example build.sbt file,

// set the initial commands when entering 'console' only
initialCommands in console := "import myproject._"

Edit: Another reference is the Scalala project. They have a Scala program that launches an embedded REPL and fills in the necessary imports. For usage, see their quick-start guide.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!