👋
Doing the pod work on spire and there's an interesting little difference that I'm not sure of how best to tackle. When the script is run under sci, inside spire, I naughtily deref sci.impl.vars/current-file to get a string representation of the present file being processed by sci.
On the pod side (that is the clojure code I send to the pod with the describe step to be evaluated by bb) I rewrite this function to use *file*
the difference is sci.impl.vars/current-file gives me a relative path. And *file* gives me a full path (like clojure does). Is there a sneaky way to get a relative path of the currently executing bb file?
You naughty boy! :). I think a less naughty way of doing this would be to use sci.core/file
if the behavior is different than JVM Clojure, then I consider that a bug. please report using a repro it so we can fix it
@retrogradeorbit but thinking more about it, I don't think SCI binds the value of file itself, this is always done by the environment using SCI, so you should probably take care of this yourself?
ah thats interesting. That would explain why its relative. I would be binding to that. It's been a while I looked in these guts...
is sci.core/file available inside bb?
I need something inside bb if there is one
in bb this var is just *file*
so in bb you would do it exactly like in clojure:
(binding [*file* ...] ...)
and outside of the env you would do it via SCI:
(sci/binding [sci/file ...] ...)yeah... I need that relative.
maybe I just need to relativise it
(it just needs to be relative for printing purposes...)
yep I am binding to sci/file in my sci implementation
and then I rebind in my load-file implementation.
sounds good!