Skip to content
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

doucmnet possibility to inject into core.ns ? #46

Open
behrica opened this issue Oct 9, 2022 · 0 comments
Open

doucmnet possibility to inject into core.ns ? #46

behrica opened this issue Oct 9, 2022 · 0 comments

Comments

@behrica
Copy link

behrica commented Oct 9, 2022

I have lately discovered that it can be very useful to dynamically inject the sc.api macros into clojure.core.

This makes them available in any ns.

Having this in a file "somewhere" and use load-lib or copy paste from somewhere into the repl,
works very well and it might be worth to be documented under tips and tricks.

(ns clojure.core)

(require 'sc.api)
(intern 'clojure.core
        (with-meta 'spy {:macro true})
        @#'sc.api/spy)

(intern 'clojure.core
        (with-meta 'defsc {:macro true})
        @#'sc.api/defsc)

(intern 'clojure.core
        (with-meta 'undefsc {:macro true})
        @#'sc.api/undefsc)

...

This together with a deps.edn alias and some .locals-dir.el magic

makes the sc.api auto-available.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant