emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/dash 97bd233 231/316: Use lexical binding for -grade-up


From: ELPA Syncer
Subject: [elpa] externals/dash 97bd233 231/316: Use lexical binding for -grade-up/down
Date: Mon, 15 Feb 2021 15:58:07 -0500 (EST)

branch: externals/dash
commit 97bd23330dbd9954daced2e18ec5969e8ab81dfd
Author: Matus Goljer <matus.goljer@gmail.com>
Commit: Basil L. Contovounesios <contovob@tcd.ie>

    Use lexical binding for -grade-up/down
---
 dash.el | 16 ++++++----------
 1 file changed, 6 insertions(+), 10 deletions(-)

diff --git a/dash.el b/dash.el
index 5f6b8e5..c7759a1 100644
--- a/dash.el
+++ b/dash.el
@@ -1758,21 +1758,17 @@ Note: `it' need not be used in each form."
   "Grade elements of LIST using COMPARATOR relation, yielding a
 permutation vector such that applying this permutation to LIST
 sorts it in ascending order."
-  ;; ugly hack to "fix" lack of lexical scope
-  (let ((comp `(lambda (it other) (funcall ',comparator (car it) (car 
other)))))
-    (->> (--map-indexed (cons it it-index) list)
-         (-sort comp)
-         (-map 'cdr))))
+  (->> (--map-indexed (cons it it-index) list)
+       (-sort (lambda (it other) (funcall comparator (car it) (car other))))
+       (-map 'cdr)))
 
 (defun -grade-down (comparator list)
   "Grade elements of LIST using COMPARATOR relation, yielding a
 permutation vector such that applying this permutation to LIST
 sorts it in descending order."
-  ;; ugly hack to "fix" lack of lexical scope
-  (let ((comp `(lambda (it other) (funcall ',comparator (car other) (car 
it)))))
-    (->> (--map-indexed (cons it it-index) list)
-         (-sort comp)
-         (-map 'cdr))))
+  (->> (--map-indexed (cons it it-index) list)
+       (-sort (lambda (it other) (funcall comparator (car other) (car it))))
+       (-map 'cdr)))
 
 (defvar dash--source-counter 0
   "Monotonic counter for generated symbols.")



reply via email to

[Prev in Thread] Current Thread [Next in Thread]