Compiled Macro cached ?

已查看 19 次
跳至第一个未读帖子

Daniel Jin

未读,
2015年10月5日 20:32:112015/10/5
收件人 scala-user
Tried under Windows and Linux, both having this:

$ ls -ltr
total 16
-rwxr-xr-x 1 tfrmrun msogrp   89 Oct  5 00:37 myTest.scala
-rw-r--r-- 1 tfrmrun msogrp  708 Oct  5 19:52 Macros.scala
-rw-r--r-- 1 tfrmrun msogrp 1659 Oct  5 19:52 Macros.class
-rw-r--r-- 1 tfrmrun msogrp 2442 Oct  5 19:52 Macros$.class
$ rm *.class
$ myTest.scala
/home/tfrmrun/eclipseWorkspace/ScalaUtils/common/myTest.scala
3

After I remove the class files, the script is still working. That will be a problem if the company deployed a new version of Macros.
I will have to remove this dir and run again, new Macro code will take effect.
rm -rf /tmp/scala-develtfrmrun

Extra step of removing temp dir after deployment is not a big problem. But this looks like a bug.
On the other hand, why do we have to compile Macro separately? Can the importing to be enforced instead of compiling? LIke this:
Macro must be import before any object can use it. When interpreter scan over the import, it will go find the Macro definition file and compile on the fly first.

Daniel Jin

未读,
2015年10月5日 20:37:012015/10/5
收件人 scala-user
I am asking to avoid compiling is hope to avoid the compilation step when deploying code.
Our company's deploying involving another infrastructure team, who only understand basic Unix command, to do compiling. 
Instead of giving details compiling and packaging instructions, and allowing them to make any kind of mistakes, deploying scripts will be simple and standard: Just tar, copy, expand.
回复全部
回复作者
转发
0 个新帖子