emacs-deferred icon indicating copy to clipboard operation
emacs-deferred copied to clipboard

[Suggestion] more ergonomic anamorphic features

Open yyoncho opened this issue 4 years ago • 1 comments

What do you think about defining a set of anamorphic versions of the functions, like this:

(defmacro deferred::nextc (d &rest body) ;; the prefix could be different.
  `(deferred:nextc ,d (lambda (result)
                        ,@body)))

Here it is how the readme example will look like(using dash's ->).

(-> (deferred::next (message "deferred start"))
    (deferred::nextc 
      (message "chain 1")
      1)
    (deferred::nextc (message "chain 2 : %s" result))
    (deferred::nextc (read-minibuffer "Input a number: "))
    (deferred::nextc (message "Got the number : %i" result))
    (deferred::error (message "Wrong input : %s" error)))

yyoncho avatar Mar 06 '20 10:03 yyoncho

any thoughts?

yyoncho avatar Apr 29 '20 16:04 yyoncho