branch: elpa/llama
commit 1fb7e99e097038e97b27d85ee9f7974583ef523f
Author: Jonas Bernoulli <[email protected]>
Commit: Jonas Bernoulli <[email protected]>
##: Use while to drop trailing unused arguments
Using `seq-drop-while' would be nicer, but we want to avoid
dependencies.
---
llama.el | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)
diff --git a/llama.el b/llama.el
index a213b577dc..1e2f8fb162 100644
--- a/llama.el
+++ b/llama.el
@@ -109,11 +109,9 @@ It also looks a bit like #\\='function."
(body (llama--collect body args))
(rest (aref args 0))
(args (nreverse (cdr (append args nil))))
- (args (let (symbols)
- (dolist (symbol args)
- (when (or symbol symbols)
- (push symbol symbols)))
- symbols))
+ (args (progn (while (and args (null (car args)))
+ (setq args (cdr args)))
+ args))
(pos 0)
(opt nil)
(args (mapcar
@@ -130,7 +128,7 @@ It also looks a bit like #\\='function."
(list symbol))
((setq opt t)
(list '&optional symbol))))
- args)))
+ (nreverse args))))
`(lambda
(,@(apply #'nconc args)
,@(and rest (list '&rest rest)))