Ignore:
Timestamp:
12/17/03 18:38:38 (18 years ago)
Author:
piso
Message:

Work in progress.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/j/src/org/armedbear/lisp/restart.lisp

    r5175 r5176  
    22;;;
    33;;; Copyright (C) 2003 Peter Graves
    4 ;;; $Id: restart.lisp,v 1.8 2003-12-17 17:53:36 piso Exp $
     4;;; $Id: restart.lisp,v 1.9 2003-12-17 18:38:38 piso Exp $
    55;;;
    66;;; This program is free software; you can redistribute it and/or
     
    7575      (nreverse res))))
    7676
     77(defun restart-report (restart stream)
     78  (funcall (or (restart-report-function restart)
     79         (let ((name (restart-name restart)))
     80     (lambda (stream)
     81       (if name (format stream "~S" name)
     82           (format stream "~S" restart)))))
     83     stream))
     84
    7785(defun find-restart (name &optional condition)
    7886  (let ((restarts (compute-restarts condition)))
     
    107115             ,@forms))))))
    108116
    109 (defun transform-keywords (&key report interactive)
     117(defun transform-keywords (&key report interactive test)
    110118  (let ((result ()))
    111119    (when report
    112       (setq result (list* (if (stringp report)
     120      (setf result (list* (if (stringp report)
    113121                              `#'(lambda (stream)
    114122                                  (write-string ,report stream))
     
    117125                          result)))
    118126    (when interactive
    119       (setq result (list* `#',interactive
     127      (setf result (list* `#',interactive
    120128                          :interactive-function
    121129                          result)))
     130    (when test
     131      (setf result (list* `#',test :test-function result)))
    122132    (nreverse result)))
    123133
     
    127137        (data
    128138         (mapcar #'(lambda (clause)
    129                     (with-keyword-pairs ((report interactive &rest forms)
     139                    (with-keyword-pairs ((report interactive test
     140                                                 &rest forms)
    130141                                         (cddr clause))
    131142                      (list (car clause)
    132143                            (gensym)
    133                             (transform-keywords :report report ;keywords=2
    134                                                 :interactive interactive)
     144                            (transform-keywords :report report
     145                                                :interactive interactive
     146                                                :test test)
    135147                            (cadr clause)
    136148                            forms)))
Note: See TracChangeset for help on using the changeset viewer.