-
-
Notifications
You must be signed in to change notification settings - Fork 652
Closed
Description
motivation
file a ticket and put there our conversation highlights. Then everything is possible. -- @bbatsov
problem
Consider the following expression:
(let [doge 20]
(def awesome (fn [x] (* x 3)))
(let [cider (awesome doge)]
(+ cider doge) ;; cursor is here
(stuff we d9n 't care about)
(more stuff we dont care about)))
Is there a wa yto make C-x C-e work ?
key idea
- find 'outermost enclosing sexp' by repeatedly looking up parent element
- prematurely end sexp by adding )]} at cursor
- evaluate the 'new parent sexp'
- in the above case, we end up executing
(let [doge 20]
(def awesome (fn [x] (* x 3)))
(let [cider (awesome doge)]
(+ cider doge) ;; cursor is here))
praise for this approach
That’s actual much simpler as we already have the code that finds the top-level expression and the only thing needed it just terminate the expression after the current sexp. Should be trivial to implement.
-- @bbatsov
Metadata
Metadata
Assignees
Labels
No labels