Changeset 14130


Ignore:
Timestamp:
08/20/12 18:39:26 (8 years ago)
Author:
ehuelsmann
Message:

Replace a Java primitive LAMBDA-LIST-NAMES with a lisp function.
Make the returned REQUIRED value from PARSE-LAMBDA-LIST match is docstring.

Location:
trunk/abcl/src/org/armedbear/lisp
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/abcl/src/org/armedbear/lisp/Closure.java

    r13850 r14130  
    221221    return arglist.match(args, environment, environment, thread);
    222222  }
    223 
    224   // ### lambda-list-names
    225   private static final Primitive LAMBDA_LIST_NAMES =
    226       new Primitive("lambda-list-names", PACKAGE_SYS, true)
    227     {
    228       @Override
    229       public LispObject execute(LispObject arg)
    230       {
    231         Closure closure = new Closure(list(Symbol.LAMBDA, arg, NIL), new Environment());
    232         return closure.getVariableList();
    233       }
    234     };
    235223}
  • trunk/abcl/src/org/armedbear/lisp/compiler-pass1.lisp

    r14111 r14130  
    108108        (t
    109109         (case state
    110            (:req (push arg req))
     110           (:req (push (list arg) req))
    111111           (:rest (setf rest (list arg)
    112112                        state :none))
     
    177177        ;;Required arguments.
    178178        (setf req-bindings
    179               (loop :for var :in req :collect `(,var ,(pop-required-argument))))
     179              (loop :for (var) :in req
     180                 :collect `(,var ,(pop-required-argument))))
    180181
    181182        ;;Optional arguments.
     
    758759    (values (nreverse other-decls)
    759760            (nreverse specific-decls))))
     761
     762(defun lambda-list-names (lambda-list)
     763  "Returns a list of variable names extracted from `lambda-list'."
     764  (multiple-value-bind
     765        (req opt key key-p rest allow-key-p aux whole env)
     766      (parse-lambda-list lambda-list)
     767    (declare (ignore key-p allow-key-p))
     768    (mapcan (lambda (x)
     769              (mapcar #'first x))
     770            (list req opt key aux rest whole env))))
     771
    760772
    761773(defun rewrite-aux-vars (form)
Note: See TracChangeset for help on using the changeset viewer.