branch: externals/async
commit 29e61448a206c6fc64e84f0bba1e67810e400f5e
Author: Thierry Volpiatto <[email protected]>
Commit: Thierry Volpiatto <[email protected]>
Allow non list bindings in async-let.
* async.el (async--fold-left): Also make arguments name more meaningful.
---
async.el | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/async.el b/async.el
index c7dabe2..0bb45fa 100644
--- a/async.el
+++ b/async.el
@@ -298,10 +298,13 @@ returns nil. It can still be useful, however, as an
argument to
"Evaluate FUNC in a separate Emacs process, synchronously."
`(async-get (async-start ,func)))
-(defun async--fold-left (f z xs)
- (let ((res z))
- (dolist (x xs)
- (setq res (funcall f res x)))
+(defun async--fold-left (fn forms bindings)
+ (let ((res forms))
+ (dolist (binding bindings)
+ (setq res (funcall fn res
+ (if (listp binding)
+ binding
+ (list binding)))))
res))
(defmacro async-let (bindings &rest forms)