Changeset 338


Ignore:
Timestamp:
Jan 19, 2004, 4:40:07 PM (21 years ago)
Author:
Gary Byers
Message:

PARSE-DEFGENERIC allows multiple DECLARE forms, passes them as :DECLARATIONS
option.
HANDLER-BIND a little less jumpy.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ccl/lib/macros.lisp

    r324 r338  
    252252                                     `(',condition ,fn))
    253253                                   (list `',condition
    254                                          `(require-type ,handler 'function)))))
     254                                         `,handler))))
    255255                           clauses))
    256256        (cluster (gensym)))   
     
    17071707  (let ((method-combination '(standard))
    17081708        (generic-function-class 'standard-generic-function)
    1709         options methods option-keywords method-class)
     1709        options declarations methods option-keywords method-class)
    17101710    (flet ((bad-option (o)
    17111711             (signal-program-error "Bad option: ~s to ~s." o 'defgeneric)))
     
    17151715          (if (eq keyword :method)
    17161716            (push `(,defmethod ,function-name ,@(%cdr o)) methods)
    1717             (cond ((memq keyword (prog1 option-keywords (push keyword option-keywords)))
     1717            (cond ((and (not (eq keyword 'declare))
     1718                        (memq keyword (prog1 option-keywords (push keyword option-keywords))))             
    17181719                   (signal-program-error "Duplicate option: ~s to ~s" keyword 'defgeneric))
    17191720                  ((eq keyword :method-name)    ; used by generic-flet
     
    17291730                   (setq generic-function-class (%cadr o)))
    17301731                  ((eq keyword 'declare)
    1731                    (push (list :declare (cdr o)) options))
     1732                   (push (cadr o) declarations))
    17321733                  ((eq keyword :argument-precedence-order)
    17331734                   (dolist (arg (cdr o))
     
    17471748      (dolist (m methods)
    17481749        (push `(:method-class ,method-class) (cddr m))))
     1750    (when declarations
     1751      (setq options `((:declarations ,declarations ,@options))))
    17491752    (values method-combination generic-function-class options methods)))
    17501753
     
    25732576
    25742577(defmacro with-terminal-input (&body body)
    2575   (let* ((old-owner (gensym)))
    2576     `(let* ((,old-owner (%request-terminal-input)))
     2578  (let* ((got-it (gensym)))
     2579    `(let* ((,got-it (%request-terminal-input)))
    25772580      (unwind-protect
    25782581           (progn ,@body)
    2579         (%restore-terminal-input ,old-owner)))))
     2582        (if ,got-it (%restore-terminal-input))))))
    25802583
    25812584(defmacro do-unexhausted-lisp-threads ((thread) &body body)
Note: See TracChangeset for help on using the changeset viewer.