Function: internal--compiler-macro-cXXr

internal--compiler-macro-cXXr is a byte-compiled function defined in subr.el.gz.

Signature

(internal--compiler-macro-cXXr FORM X)

Aliases

cl--compiler-macro-cXXr (obsolete since 25.1)

Source Code

;; Defined in /usr/src/emacs/lisp/subr.el.gz
;;;; List functions.

;; Note: `internal--compiler-macro-cXXr' was copied from
;; `cl--compiler-macro-cXXr' in cl-macs.el.  If you amend either one,
;; you may want to amend the other, too.
(defun internal--compiler-macro-cXXr (form x)
  (let* ((head (car form))
         (n (symbol-name (car form)))
         (i (- (length n) 2)))
    (if (not (string-match "c[ad]+r\\'" n))
        (if (and (fboundp head) (symbolp (symbol-function head)))
            (internal--compiler-macro-cXXr (cons (symbol-function head) (cdr form))
                                     x)
          (error "Compiler macro for cXXr applied to non-cXXr form"))
      (while (> i (match-beginning 0))
        (setq x (list (if (eq (aref n i) ?a) 'car 'cdr) x))
        (setq i (1- i)))
      x)))