(can-inline-fn? zloc uri db)returns true if a function can be inlined; false otherwise
returns true if a function can be inlined; false otherwise
(change-coll zloc coll)Change collection to specified collection
Change collection to specified collection
(cond->if zloc)transforms a cond form into an equivalent if form
transforms a cond form into an equivalent if form
(cycle-coll zloc)Cycles collection between vector, list, map and set
Cycles collection between vector, list, map and set
(expand-let zloc uri db)(expand-let zloc expand-to-top? uri db)Expand the scope of the next let up the tree.
Expand the scope of the next let up the tree.
(extract-function row-start
col-start
end-row
end-col
sel-start-zloc
sel-end-zloc
uri
fn-name
db)Extract selected expressions to a new function and replace with a function call. If no selection, extract the expression to the right. When selection start and end zlocs don't have the same parent or no expressions are found, return an error.
Extract selected expressions to a new function and replace with a function call. If no selection, extract the expression to the right. When selection start and end zlocs don't have the same parent or no expressions are found, return an error.
(find-let-form zloc uri db)Finds a let-form that would be valid to move zloc to
Finds a let-form that would be valid to move zloc to
(if->cond zloc)transforms an if form into an equivalent cond form
transforms an if form into an equivalent cond form
(inline-function zloc uri db)copies the function body to the call sites, substituting formal parameters with the actual parameters from the call site. call sites are outside of the current file. Limitations:
copies the function body to the call sites, substituting formal parameters with the actual parameters from the call site. call sites are outside of the current file. Limitations: - functions with destructuring will return an error - multi-arity functions are disallowed (although varargs are allowed) - recursive functions will inline with the recursive calls still present - functions that have side effects may have incorrect behavior - only works with functions contained in the file with the definition - when a call site uses threading or otherwise doesn't list all the arguments explictly, the arguments are not adjusted
(introduce-let zloc binding-name)Adds a let around the current form.
Adds a let around the current form.
(move-to-for-let zloc _uri _db binding-name)Adds form and symbol to a :let in a for/doseq further up the tree
Adds form and symbol to a :let in a for/doseq further up the tree
(move-to-let zloc uri db binding-name)Adds form and symbol to a let further up the tree
Adds form and symbol to a let further up the tree
(near-cond? zloc)return true if nearby a 'cond', otherwise return false
return true if nearby a 'cond', otherwise return false
(near-if? zloc)return true if nearby an 'if', otherwise return false
return true if nearby an 'if', otherwise return false
(prepend-preserving-comment existing-loc new-loc)Returns an edit that places new-loc before existing-loc, keeping any
comments or whitespace that preceed existing-loc close to it.
Returns an edit that places `new-loc` before `existing-loc`, keeping any comments or whitespace that preceed `existing-loc` close to it.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |