;;; Code:
(eval-when-compile (require 'cl-lib))
+(eval-when-compile (require 'subr-x))
;; -------------------------------------------------------------------------
;;; Section: Configuration.
;; compiled. Otherwise the byte-compiler and all the code on
;; which it depends needs to be usable before cl-generic is loaded,
;; which imposes a significant burden on the bootstrap.
- (if (consp (lambda (x) (+ x 1)))
- (lambda (exp) (eval exp t)) #'byte-compile))
+ (if (or (consp (lambda (x) (+ x 1)))
+ (not (featurep 'bytecomp)))
+ (lambda (exp) (eval exp t))
+ #'byte-compile))
(defun cl--generic-get-dispatcher (dispatch)
(with-memoization
(funcall
cl--generic-compiler
`(lambda (generic dispatches-left methods)
- ;; FIXME: We should find a way to expand `with-memoize' once
- ;; and forall so we don't need `subr-x' when we get here.
- (eval-when-compile (require 'subr-x))
(let ((method-cache (make-hash-table :test #'eql)))
(lambda (,@fixedargs &rest args)
(let ,bindings
(cl-labels ((,name ,fargs . ,body)) #',name)
. ,aargs)))
-(defmacro with-memoization (place &rest code)
- "Return the value of CODE and stash it in PLACE.
-If PLACE's value is non-nil, then don't bother evaluating CODE
-and return the value found in PLACE instead."
- (declare (indent 1) (debug (gv-place body)))
- (gv-letplace (getter setter) place
- `(or ,getter
- ,(macroexp-let2 nil val (macroexp-progn code)
- `(progn
- ,(funcall setter val)
- ,val)))))
-
-
;;;###autoload
(defun string-pixel-width (string)
"Return the width of STRING in pixels."
(require 'wid-edit)
(require 'cl-lib)
(require 'eudc-vars)
+(eval-when-compile (require 'subr-x))
;;{{{ Internal cooking
;;; Code:
(require 'cl-lib)
+(eval-when-compile (require 'subr-x))
(declare-function sqlite-execute "sqlite.c")
(declare-function sqlite-more-p "sqlite.c")
(push buf bufs)))
bufs))
+(defmacro with-memoization (place &rest code)
+ "Return the value of CODE and stash it in PLACE.
+If PLACE's value is non-nil, then don't bother evaluating CODE
+and return the value found in PLACE instead."
+ (declare (indent 1) (debug (gv-place body)))
+ (gv-letplace (getter setter) place
+ `(or ,getter
+ ,(macroexp-let2 nil val (macroexp-progn code)
+ `(progn
+ ,(funcall setter val)
+ ,val)))))
+
;;; subr.el ends here
(require 'wid-edit)
(require 'cus-edit)
+(require 'bytecomp)
(ert-deftest custom-theme--load-path ()
"Test `custom-theme--load-path' behavior."
(require 'ert)
(require 'cl-lib)
(require 'generator)
+(require 'bytecomp)
(ert-deftest cconv-tests-lambda-:documentation ()
"Docstring for lambda can be specified with :documentation."