Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Suggestion] more ergonomic anamorphic features #56

Open
yyoncho opened this issue Mar 6, 2020 · 1 comment
Open

[Suggestion] more ergonomic anamorphic features #56

yyoncho opened this issue Mar 6, 2020 · 1 comment

Comments

@yyoncho
Copy link

yyoncho commented Mar 6, 2020

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
Copy link
Author

yyoncho commented Apr 29, 2020

any thoughts?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant