aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSean Allred <code@seanallred.com>2015-01-16 00:45:35 -0500
committerSean Allred <code@seanallred.com>2015-01-16 00:45:35 -0500
commit6c4e7c6b95e8bd7d83e5d0f868d9fb3a70c7a974 (patch)
treeb1ebba3807e63417d13512aaaaa0c86ca72b766b
parent7470438d4455e38e4f7b749579470d4af2b66751 (diff)
Don't define aliases with comparators
The aliases were created in the fear that runtime would be slower to interpret the duplicated lambda expressions for get-func. After testing, this was found not to be the case. `funcall' is a much nicer solution.
-rw-r--r--sx.el19
1 files changed, 8 insertions, 11 deletions
diff --git a/sx.el b/sx.el
index 1cfba12..829570f 100644
--- a/sx.el
+++ b/sx.el
@@ -264,17 +264,14 @@ whenever BODY evaluates to nil."
COMPARE-FUNC is a function that takes the return value of
GET-FUNC and performs the actual comparison."
(declare (indent 1) (doc-string 2))
- (let ((gf (intern (format " %S--get-prop-function" name)))
- (cf (intern (format " %S--compare-function" name))))
- ;; Leading space to hide from completion systems
- `(progn
- ;; In using `defalias', the macro supports both function
- ;; symbols and lambda expressions.
- (defalias ',gf ,get-func)
- (defalias ',cf ,compare-func)
- (defun ,name (a b)
- ,doc
- (,cf (,gf a) (,gf b))))))
+ `(progn
+ ;; In using `defalias', the macro supports both function
+ ;; symbols and lambda expressions.
+ (defun ,name (a b)
+ ,doc
+ (funcall ,compare-func
+ (funcall ,get-func a)
+ (funcall ,get-func b)))))
;;; Printing request data