Changeset 11133


Ignore:
Timestamp:
Oct 17, 2008, 1:18:52 PM (11 years ago)
Author:
gz
Message:

From working-0711 branch, arg-names-from-map: it's valid for argless fn to have no map

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/lib/arglist.lisp

    r10115 r11133  
    161161(defun arglist-from-map (lfun)
    162162  (multiple-value-bind (nreq nopt restp nkeys allow-other-keys
    163                              optinit lexprp
    164                              ncells nclosed)
     163                        optinit lexprp
     164                        ncells nclosed)
    165165      (function-args lfun)
    166166    (declare (ignore optinit))
     
    186186                (push (if lexprp '&lexpr '&rest) res)
    187187                (push (if (> idx 0) (elt map (decf idx)) 'the-rest) res))
    188               (when nkeys
     188              (when nkeys
    189189                (push '&key res)
    190190                (let ((keyvect (lfun-keyvect lfun)))
     
    213213            (unless (zerop total)
    214214              (progn
    215                 (dotimes (x nreq)
     215                (dotimes (x (the fixnum nreq))
    216216                  (declare (fixnum x))
    217217                  (req (if (> idx 0) (elt map (decf idx)) (make-arg "ARG" x))))
     
    222222                  (setq rest (if (> idx 0) (elt map (decf idx)) 'the-rest)))
    223223                (when nkeys
    224                   (dotimes (i (the fixnum nkeys))
     224                  (dotimes (i (the fixnum nkeys))
    225225                    (keys (if (> idx 0) (elt map (decf idx)) (make-arg "KEY" i)))))))))
    226         (values (not (null map)) (req) (opt) rest (keys))))))
     226        (values (or (not (null map))
     227                    (and (eql 0 nreq) (eql 0 nopt) (not restp) (null nkeys)))
     228                (req) (opt) rest (keys))))))
    227229             
    228230             
Note: See TracChangeset for help on using the changeset viewer.