- About Scala
- Documentation
- Code Examples
- Software
- Scala Developers
#include for scala script ?
Fri, 2012-01-27, 00:02
Hi,
I did some search and didn't find any default way to include a scala script file inside an other one, in order for example to share common definitions accross multiple scala scripts. So I made some experiments, and share the results there : http://www.crosson.org/2012/01/simplifying-scala-scripts.html .I was wondering If there is already some initiative about this kind of feature ? May be it is already scheduled in a next scala release ?
thanks.
I did some search and didn't find any default way to include a scala script file inside an other one, in order for example to share common definitions accross multiple scala scripts. So I made some experiments, and share the results there : http://www.crosson.org/2012/01/simplifying-scala-scripts.html .I was wondering If there is already some initiative about this kind of feature ? May be it is already scheduled in a next scala release ?
thanks.
Fri, 2012-01-27, 08:01
#2
Re: #include for scala script ?
:load is only available for scala console, not for scripts.
Fri, 2012-01-27, 08:11
#3
Re: #include for scala script ?
I'm pretty sure I've used it in scripts; have you tried it? I'll check again when I get home.
On 27 January 2012 17:51, david crosson <crosson.david@gmail.com> wrote:
On 27 January 2012 17:51, david crosson <crosson.david@gmail.com> wrote:
:load is only available for scala console, not for scripts.
Fri, 2012-01-27, 11:11
#4
Re: #include for scala script ?
Aaah right. What I had done was have a whole of script files with :load in them -- but I was loading the first one through the REPL, which meant that they were all interpreted within the REPL context. Looks like it doesn't work when you run the script directly from the command line, as you say.
Cheers,
Ken
On 27 January 2012 18:07, Ken Scambler <ken.scambler@gmail.com> wrote:
Cheers,
Ken
On 27 January 2012 18:07, Ken Scambler <ken.scambler@gmail.com> wrote:
I'm pretty sure I've used it in scripts; have you tried it? I'll check again when I get home.
On 27 January 2012 17:51, david crosson <crosson.david@gmail.com> wrote:
:load is only available for scala console, not for scripts.
Tue, 2012-01-31, 14:51
#5
Re: #include for scala script ?
A script #include directive implementation example :
http://www.crosson.org/2012/01/simplifying-scala-scripts-adding.html
It works fine and allow sharing code between scripts.
Regards.
On 27 January 2012 10:02, david crosson <crosson.david@gmail.com> wrote: