New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add get-extension-context to joyride.core #34
Conversation
I'll have a look tomorrow! |
src/main/joyride/sci.cljs
Outdated
@@ -20,7 +22,9 @@ | |||
(sci/init {:classes {'js goog/global | |||
:allow :all} | |||
:namespaces (assoc (:namespaces pconfig/config) | |||
'joyride.core {'*file* sci/file}) | |||
'joyride.core {'*file* sci/file | |||
'get-extension-context (fn [] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR looks good, but I'd prefer if get-extension context was a "true" var inside the SCI config. You can create it by defining get-extension-context
with defn
and then use (sci/copy-var get-extension (sci/create-ns 'joyride.core))
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This would also allow you to add a docstring to it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And get it using clojure.repl/doc
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! Where would I do the copying?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Look around in nbb.core for copy-var and you'll find an example. Sorry, tight schedule today!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had already started poking around there. I think I have fixed it in a proper way now. And doc lookup works as well, added it to the Joyride API example while at it.
Good to merge?
I took the ”PR looks good” hint. 😄 |
Adds a function to
joyride.core
for getting the Joyride extension context.Fixes #33