Could it be that 2 invocations of different script...
# scripting
n
Could it be that 2 invocations of different scripts that use the same library cannot reuse instances of objects across different evaluations? so far i only tried with simple things like Strings, lists of sorts but i now tested with krangle.DataFrame and it blows up i nthe weirdest ways
i
If you need to share an object created by one script with another script in different invocation - this is non-trivial. Maybe it is better to construct a repl instead of independent evaluations. Unfortunately REPL part of the new scripting API is unfinished, so there is not the same level of support. You can try to use JSR-223 for that, but you’ll loose quite some features of the new scripting probably.
n
actually solved it.. it works when i made sure to put eg. krangl in the fat jar
i
That’s great, but I don’t understand how fat jar may help here.
n
tbf, i did not expect it to work that easily, but it seems like adding dependencies using dependenciesFromCurrentContext(wholeClasspath = false)` is not making the jvm treat them as seperate classes
the other way to add dependencies to scriptCOmpilation is via passing the jars as a JVMDependency or so (not sure if thats the term) those i think get loaded as seperate classes on seperate evaluations
i hope i am making sense here 😛 , feel free to look at the repo i linked in the last messages to the channel, to check out what we are doing