(list (list beg len (alist-get bare local))))))
(defun scope-let (local bindings body)
- (append
+ (nconc
(mapcan (lambda (binding)
(if (consp binding)
(cons
(defun scope-let* (local bindings body)
(if bindings
(let ((binding (car bindings)))
- (append
+ (nconc
(if (consp binding)
(cons
(let* ((sym (car binding))
(eq (bare-symbol (caar body)) 'interactive))
(setq int-spec (cadar body))
(setq body (cdr body)))
- (append
+ (nconc
(seq-keep (lambda (arg)
(and (symbol-with-pos-p arg)
(not (memq (bare-symbol arg) '(&optional &rest _)))
(len (length (symbol-name bare))))
(cons
(list beg len beg)
- (append
+ (nconc
(cond
((consp spec)
(let ((head (car spec))
(len (length (symbol-name bare))))
(cons
(list beg len beg)
- (append
+ (nconc
(cond
((consp spec)
(let ((head (car spec))
(len (length (symbol-name bare))))
(cons
(list beg len beg)
- (append
+ (nconc
(scope-1 local0 init)
(when svar
(let ((sbeg (symbol-with-pos-pos svar)))
(expr (car expr-type))
(type (cadr expr-type))
(more (cddr args)))
- (append
+ (nconc
(scope-1 local0 expr)
(cond
((consp type)
(scope-defgeneric-1 local name args (cdr body)))
((and (consp (car body)) (symbol-with-pos-p (caar body))
(eq (bare-symbol (caar body)) :method))
- (append
+ (nconc
(scope-defmethod local nil (cdar body))
(scope-defgeneric-1 local name args (cdr body))))
;; FIXME: `args' may include `&key', so defun is not a perfect match.
(scope-defgeneric-1 local name args (cdr body)))
((and (consp (car body)) (symbol-with-pos-p (caar body))
(eq (bare-symbol (caar body)) :method))
- (append
+ (nconc
(scope-defmethod local nil (cdar body))
(scope-defgeneric-1 local name args (cdr body))))
(t (scope-defgeneric-2 local name args body))))
(defun scope-defvar (local _sym init) (scope-1 local init))
(defun scope-condition-case (local var bodyform handlers)
- (append
+ (nconc
(when var
(let* ((beg (symbol-with-pos-pos var))
(bare (bare-symbol var)))
(let* ((beg (symbol-with-pos-pos var))
(bare (bare-symbol var)))
(list beg (length (symbol-name bare)) beg))
- (append
+ (nconc
(scope-1 local lst)
(scope-1 local res)
(let ((l (cons (cons (bare-symbol var) (symbol-with-pos-pos var)) local)))
(l (car l-r0))
(r0 (cdr l-r0))
(l-r (scope-pcase-qpat l (cdr qpat))))
- (cons (car l-r) (append r0 (cdr l-r))))))
+ (cons (car l-r) (nconc r0 (cdr l-r))))))
;; FIXME: Support vector qpats.
(t (list local))))
(let* ((l-r (scope-pcase-pattern local pattern))
(l (car l-r))
(r (cdr l-r)))
- (when l (append r (scope-n l body)))))
+ (when l (nconc r (scope-n l body)))))
(defun scope-pcase (local exp cases)
- (append
+ (nconc
(scope-1 local exp)
(mapcan
(lambda (case)
cases)))
(defun scope-push (local new place)
- (append (scope-1 local new) (scope-1 local place)))
+ (nconc (scope-1 local new) (scope-1 local place)))
(defun scope-minibuffer-with-setup-hook (local fun body)
- (append
+ (nconc
(scope-1 local (if (and (symbol-with-pos-p (car-safe fun))
(eq :append (bare-symbol (car-safe fun))))
(cadr fun)
(cons
(list (symbol-with-pos-pos func) (length (symbol-name (bare-symbol func)))
(symbol-with-pos-pos func))
- (append
+ (nconc
(if (cdr exps)
;; def is (FUNC ARGLIST BODY...)
(scope-defun local nil (car exps) (cdr exps))
(symbol-with-pos-pos func))
(let ((scope-flet-list (cons (bare-symbol func) scope-flet-list))
(l (cons (cons (bare-symbol func) (symbol-with-pos-pos func)) local)))
- (append
+ (nconc
(scope-defun l nil args body)
(scope-flet l (cdr defs) forms)))))
(scope-n local forms)))
(len (length (symbol-name bare))))
(cons
(list beg len beg)
- (append
+ (nconc
(scope-1 local init)
(scope-cl-defun-aux (cons (cons bare beg) local)
name (cdr args) body)))))))
(len (length (symbol-name bare))))
(cons
(list beg len beg)
- (append
+ (nconc
(scope-1 local init)
(when svar
(let ((sbeg (symbol-with-pos-pos svar)))
(len (length (symbol-name bare))))
(cons
(list beg len beg)
- (append
+ (nconc
(scope-1 local init)
(when svar
(let ((sbeg (symbol-with-pos-pos svar)))
(defun scope-seq-let (local args sequence body)
(nconc
(scope-1 local sequence)
- (append
- (mapcar (lambda (arg)
- (let* ((beg (symbol-with-pos-pos arg))
- (bare (bare-symbol arg))
- (len (length (symbol-name bare))))
- (list beg len beg)))
- args)
- (scope-n (append
- (mapcar (lambda (arg)
- (cons (bare-symbol arg) (symbol-with-pos-pos arg)))
- args)
- local)
- body))))
+ (mapcar (lambda (arg)
+ (let* ((beg (symbol-with-pos-pos arg))
+ (bare (bare-symbol arg))
+ (len (length (symbol-name bare))))
+ (list beg len beg)))
+ args)
+ (scope-n (append
+ (mapcar (lambda (arg)
+ (cons (bare-symbol arg) (symbol-with-pos-pos arg)))
+ args)
+ local)
+ body)))
(defun scope-pcase-lambda (local lambda-list body)
(if lambda-list
(let* ((l-r (scope-pcase-pattern local (car lambda-list)))
(l (car l-r))
(r (cdr l-r)))
- (when l (append r (scope-pcase-lambda l (cdr lambda-list) body))))
+ (when l (nconc r (scope-pcase-lambda l (cdr lambda-list) body))))
(scope-n local body)))
(defun scope-pcase-dolist (local pattern lst body)
(lambda (forms) (scope-condition-case local (car forms) (cadr forms) (cddr forms))))
(t #'ignore)))
((memq bare scope-flet-list)
- (lambda (forms) (append (scope-s local f)
- (scope-n local forms))))
+ (lambda (forms) (nconc (scope-s local f)
+ (scope-n local forms))))
;; FIXME: Assume unknown symbols refer to functions, unless at
;; top level.
(t #'ignore))))