Changeset 8489
- Timestamp:
- Feb 14, 2008, 1:10:47 AM (17 years ago)
- File:
-
- 1 edited
-
trunk/source/lib/macros.lisp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/lib/macros.lisp
r8269 r8489 3568 3568 consing when N is a trivial constant integer." 3569 3569 `(car (nthcdr ,n (multiple-value-list ,form)))) 3570 3571 3572 3573 (defmacro with-input-timeout (((stream-var &optional (stream-form stream-var)) timeout) &body body) 3574 "Execute body with STREAM-VAR bound to STREAM-FORM and with that stream's 3575 stream-input-timeout set to TIMEOUT." 3576 (let* ((old-input-timeout (gensym)) 3577 (stream (gensym))) 3578 `(let* ((,stream ,stream-form) 3579 (,stream-var ,stream) 3580 (,old-input-timeout (stream-input-timeout ,stream))) 3581 (unwind-protect 3582 (progn 3583 (setf (stream-input-timeout ,stream) ,timeout) 3584 ,@body) 3585 (setf (stream-input-timeout ,stream) ,old-input-timeout))))) 3586 3587 (defmacro with-output-timeout (((stream-var &optional (stream-form stream-var)) timeout) &body body) 3588 "Execute body with STREAM-VAR bound to STREAM-FORM and with that stream's 3589 stream-output-timeout set to TIMEOUT." 3590 (let* ((old-output-timeout (gensym)) 3591 (stream (gensym))) 3592 `(let* ((,stream ,stream-form) 3593 (,stream-var ,stream) 3594 (,old-output-timeout (stream-output-timeout ,stream))) 3595 (unwind-protect 3596 (progn 3597 (setf (stream-output-timeout ,stream) ,timeout) 3598 ,@body) 3599 (setf (stream-output-timeout ,stream) ,old-output-timeout)))))
Note:
See TracChangeset
for help on using the changeset viewer.
