Skip to content

Feature request: call function at point and prompt arguments #1767

Closed
@mallt

Description

@mallt

When writing a clojure function I often find it helpful to repeatedly call the function with the same parameters and get the result as an overlay in the buffer.
I use a simple function for this at the moment that applies the hard coded arguments I want to test to the function at point:

(defun call-clj-function-at-point () (interactive) (save-buffer) (cider-interactive-eval (concat "(apply " (cider-current-ns) "/" (second (split-string (cider-defun-at-point))) " [4 6])") nil (list (point) (point)) nil))

Applied to a simple sum function this gives the following result:

(defn sum [a b] (+ a b)) => 10

Instead of hard coding the arguments, I would like to be able to supply them the first time I call this function (f.ex. in the minibuffer). When I call the function again, I would like
the previous arguments to be applied by default, but get the option to supply different arguments to test other cases.

Does this sound like a feasible idea? Or are there already alternatives available to accomplish the same result?

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions