Arity function

Is there a way in clojurescript to verify that available arity implementations of a given cljs function are available?

+4
source share
2 answers

If you start Emacs using nREPL, as described in this entity , when your text cursor is next to the function name, Emacs will show the function signatures in the message area.

Like this: emacs-screenshot

+1
source

Rodrigo Taboada's only answer is dated, and now many new tools have appeared.

Light table and wheel

I think that today Light Table is one of the best tools for ClojureScript, especially in combination with Figwheel . Additional information for using LT with Figwheel .

In the table "Light", to check the signature of the function, you can simply hover over the name of the function and press Ctrl-D to switch the built-in documentation.

LT inline doc

Emacs and Cider + Figwheel

For Emacs, Cider combined with Figwheel is an excellent choice, an interactive replacement, and a debugger inside Emacs.

To test the function, you can use the shortcut Ctrl-c dd to show the documentation and the signature of the function.

emacs_cider_docs

Setting up the Sider is not easy at first, but Figwheel makes the task easier, just do not comment out the line under the comment ;; for CIDER ;; for CIDER in your project.clj file of your Figwheel project, for example:

 :profiles {:dev {:dependencies [[binaryage/devtools "0.7.2"] [figwheel-sidecar "0.5.4-7"] [com.cemerick/piggieback "0.2.1"]] ;; need to add dev source path here to get user.clj loaded :source-paths ["src" "dev"] ;; for CIDER :plugins [[cider/cider-nrepl "0.13.0"]] :repl-options {; for nREPL dev you really need to limit output :init (set! *print-length* 50) :nrepl-middleware [cemerick.piggieback/wrap-cljs-repl]}}} 

Then install Cider to use figwheel as repl:

Mx then run the command customize-variable , the name of the variable to configure: cider-cljs-lein-repl then set the variable to Figwheel-sidecar , save the configuration state, and you Figwheel-sidecar done.

It is important that Cider is the same version of the cider-nrepl , during this message they HAVE both versions 0.13.0 .

0
source

All Articles