(scope-local-new bare beg local) (cdr bindings) body))
(scope-n local body)))
-(defun scope-if-let* (local bindings body)
- (if bindings
- (let ((binding (car bindings)))
- (if (consp binding)
- (if (cdr binding)
- ;; BINDING is (SYMBOL VALUEFORM).
- (let* ((sym (car binding))
- (bare (bare-symbol sym))
- (beg (scope-sym-pos sym)))
- (when beg
- (funcall scope-callback 'variable
- beg (length (symbol-name bare)) beg))
- (scope-1 local (cadr binding))
- (scope-if-let* (scope-local-new bare beg local)
- (cdr bindings) body))
- ;; BINDING is (VALUEFORM).
- (scope-1 local (car binding))
- (scope-if-let* local (cdr bindings) body))
- ;; BINDING is just SYMBOL.
- (let* ((sym binding)
- (bare (bare-symbol sym))
- (beg (scope-sym-pos sym)))
- (when beg
- (funcall scope-callback 'variable
- beg (length (symbol-name bare)) beg))
- (scope-if-let* (scope-local-new bare beg local)
- (cdr bindings) body))))
- (scope-n local body)))
-
-(defun scope-if-let (local bindings body)
- (scope-if-let* local
- (if (and (consp bindings)
- (or (symbol-with-pos-p (car bindings))
- (symbolp (car bindings))))
- (list bindings)
- bindings)
- body))
-
(defun scope-lambda (local args body)
(let ((int-spec nil)
(doc-form nil))
(scope-1 local bodyform)
(dolist (handler handlers) (scope-n l (cdr handler)))))
-(defun scope--backquote (local elements depth)
- (cond
- ((zerop depth) (scope-n local elements))
- ((consp elements)
- (cond
- ((memq (car elements) '(\, \,@))
- (scope--backquote local (cdr elements) (1- depth)))
- ((eq (car elements) '\`)
- (scope--backquote local (cdr elements) (1+ depth)))
- (t (scope--backquote local (car elements) depth)
- (scope--backquote local (cdr elements) depth))))
- ((vectorp elements)
- (scope--backquote local (append elements nil) depth))))
-
-(defun scope-backquote (local elements &optional depth)
- (scope--backquote local elements (or depth 1)))
-
(defvar scope-flet-alist nil)
(defun scope-flet (local defs body)