A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/clojure-emacs/clj-refactor.el/wiki/cljr-promote-function below:

cljr promote function · clojure-emacs/clj-refactor.el Wiki · GitHub

Promote function literal to anonymous function

Given this:

(map #(-> % (str "!") symbol) '[aww yeah])

And I place my cursor on symbol and do cljr-promote-function and rename % to sym:

 (map (fn [sym] (-> sym (str "!") symbol)) '[aww yeah])

With a prefix it will promote the function literal all the way to a defn.

Promote anonymous function to defn

Given this:

 (map (fn [sym] (-> sym (str "!") symbol)) '[aww yeah])

And I place my cursor on symbol and do cljr-promote-function and call the fn shout-it!

(defn shout-it!
  [sym]
  (-> sym (str "!") symbol))

(map shout-it! '[aww yeah])


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4