From 38ef86e0bdbe736264e089ba03bf2c07ec9e6c7d Mon Sep 17 00:00:00 2001 From: Fredrik Bergroth Date: Sun, 7 Dec 2014 01:10:48 +0100 Subject: [PATCH 1/3] Update debug forms for -if-let and -when-let --- dash.el | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/dash.el b/dash.el index 0d2f33c..51aa3ec 100644 --- a/dash.el +++ b/dash.el @@ -1497,7 +1497,7 @@ VARS and do THEN, otherwise do ELSE. VARS-VALS should be a list of (VAR VAL) pairs. Note: binding is done according to `-let'." - (declare (debug ((&rest (symbolp form)) form body)) + (declare (debug ((&rest (sexp form)) form body)) (indent 2)) (->> vars-vals (-mapcat (-lambda ((pat src)) (dash--match pat src))) @@ -1512,7 +1512,7 @@ Note: binding is done according to `-let'." otherwise do ELSE. VAR-VAL should be a (VAR VAL) pair. Note: binding is done according to `-let'." - (declare (debug ((symbolp form) form body)) + (declare (debug ((sexp form) form body)) (indent 2)) `(-if-let* (,var-val) ,then ,@else)) @@ -1529,7 +1529,7 @@ VARS and execute body. VARS-VALS should be a list of (VAR VAL) pairs. Note: binding is done according to `-let'." - (declare (debug ((&rest (symbolp form)) body)) + (declare (debug ((&rest (sexp form)) body)) (indent 1)) `(-if-let* ,vars-vals (progn ,@body))) @@ -1538,7 +1538,7 @@ Note: binding is done according to `-let'." VAR-VAL should be a (VAR VAL) pair. Note: binding is done according to `-let'." - (declare (debug ((symbolp form) body)) + (declare (debug ((sexp form) body)) (indent 1)) `(-if-let ,var-val (progn ,@body))) From c134705f2a94fffa368505b5ac3660aeaea43aa0 Mon Sep 17 00:00:00 2001 From: Fredrik Bergroth Date: Sun, 7 Dec 2014 01:11:10 +0100 Subject: [PATCH 2/3] Fix compile warning --- dash.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dash.el b/dash.el index 51aa3ec..d701512 100644 --- a/dash.el +++ b/dash.el @@ -1126,8 +1126,8 @@ sorts it in descending order." `(pop ,source)) (t `(progn - (setq ,s (nthcdr ,skip-cdr ,s)) - (pop ,s))))) + (setq ,source (nthcdr ,skip-cdr ,source)) + (pop ,source))))) (defun dash--match-cons-get-car (skip-cdr source) "Helper function generating idiomatic code to get nth car." From 47e11aed6103fb31798deb3c4c188e0e0a2942cc Mon Sep 17 00:00:00 2001 From: Fredrik Bergroth Date: Sun, 7 Dec 2014 11:23:43 +0100 Subject: [PATCH 3/3] Update docs Binding behaves like -let* rather than -let. --- README.md | 6 +++--- dash.el | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 555da08..b3635d4 100644 --- a/README.md +++ b/README.md @@ -1677,7 +1677,7 @@ If all `vals` evaluate to true, bind them to their corresponding `vars` and execute body. `vars-vals` should be a list of (`var` `val`) pairs. -Note: binding is done according to [`-let`](#-let-varlist-rest-body). +Note: binding is done according to [`-let*`](#-let-varlist-rest-body). ```el (-when-let* ((x 5) (y 3) (z (+ y 4))) (+ x y z)) ;; => 15 @@ -1702,7 +1702,7 @@ If all `vals` evaluate to true, bind them to their corresponding `vars` and do `then`, otherwise do `else`. `vars-vals` should be a list of (`var` `val`) pairs. -Note: binding is done according to [`-let`](#-let-varlist-rest-body). +Note: binding is done according to [`-let*`](#-let-varlist-rest-body). ```el (-if-let* ((x 5) (y 3) (z 7)) (+ x y z) "foo") ;; => 15 @@ -2256,7 +2256,7 @@ Change `readme-template.md` or `examples-to-docs.el` instead. - [Johan Andersson](https://github.com/rejeep) contributed `-sum`, `-product` and `-same-items?` - [Christina Whyte](https://github.com/kurisuwhyte) contributed `-compose` - [Steve Lamb](https://github.com/steventlamb) contributed `-cycle`, `-pad`, `-annotate`, `-zip-fill` and an n-ary version of `-zip`. - - [Fredrik Bergroth](https://github.com/fbergroth) made the `-if-let` family use `-let` desctructuring and improved script for generating documentation. + - [Fredrik Bergroth](https://github.com/fbergroth) made the `-if-let` family use `-let` destructuring and improved script for generating documentation. Thanks! diff --git a/dash.el b/dash.el index d701512..74dbcab 100644 --- a/dash.el +++ b/dash.el @@ -1496,7 +1496,7 @@ See `-let' for the description of destructuring mechanism." VARS and do THEN, otherwise do ELSE. VARS-VALS should be a list of (VAR VAL) pairs. -Note: binding is done according to `-let'." +Note: binding is done according to `-let*'." (declare (debug ((&rest (sexp form)) form body)) (indent 2)) (->> vars-vals @@ -1528,7 +1528,7 @@ otherwise do ELSE." VARS and execute body. VARS-VALS should be a list of (VAR VAL) pairs. -Note: binding is done according to `-let'." +Note: binding is done according to `-let*'." (declare (debug ((&rest (sexp form)) body)) (indent 1)) `(-if-let* ,vars-vals (progn ,@body)))