You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I tried to get the same effect in a variety of ways
I attempted to cat a file into the option's value via the command line --predef $(cat "${PATH_TO_PREDEF}/spark_predef.scala"), and while that didn't cause it to fail to start… none of the content was actually run.
cat and join everything onto a single line, adding semi-colons to the end of lines based on key words.
This effectively required getting rid of all comments; but still did not work
passing in a $exec and $file command to load the script
This didn't work because the dependencies had not yet been resolved at the time that they needed to be inside the script (see http://ammonite.io/#Multi-stageScripts)
or if I added a @ the almond interpreter attempted to reload all of the other predefs again (as well as the predef I supplied) and crashed
or if I removed the need for those dependencies to be completely resolved… it also attempted to reload the other predefs again (as well as the predef I supplied) and then crashed
So… I'm thinking there's no good way to do this right now.
Is there a reason almond does not replicate ammonite's --predef file functionality? If the reason is only "we haven't done that yet", how would we go about changing that?
I would use this as well. For now, since I had already created my own kernel using the almond ScalaInterpreter, I just read the file in my own code, then pass this into the predef constructor argument.
In Ammonite, you can pass in a file to the
--predef
command line option. It seems that almond only allows you to pass in a string that implements some scala code.I tried to get the same effect in a variety of ways
cat
a file into the option's value via the command line--predef $(cat "${PATH_TO_PREDEF}/spark_predef.scala")
, and while that didn't cause it to fail to start… none of the content was actually run.cat
and join everything onto a single line, adding semi-colons to the end of lines based on key words.$exec
and$file
command to load the script@
the almond interpreter attempted to reload all of the other predefs again (as well as the predef I supplied) and crashedSo… I'm thinking there's no good way to do this right now.
Is there a reason almond does not replicate ammonite's
--predef
file functionality? If the reason is only "we haven't done that yet", how would we go about changing that?@jameskoch2 @alexarchambault @MSeal
The text was updated successfully, but these errors were encountered: