Changeset 8989


Ignore:
Timestamp:
Apr 2, 2008, 8:16:28 AM (11 years ago)
Author:
gb
Message:

CHECK-TYPE: do the TYPEP call(s) inline, call (new) %CHECK-TYPE
to signal error and provide STORE-VALUE restart.

INGORING-EINTR: allow implicit PROGN, as suggested by use
of &BODY.

FF-CALL-IGNORING-EINTR: like IGNORING-EINTR, but assume that BODY
returns a C library result and we have to call %GET-ERRNO.

File:
1 edited

Legend:

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

    r8866 r8989  
    26462646  used to return, this can only return if the STORE-VALUE restart is
    26472647  invoked. In that case it will store into PLACE and start over."
    2648   `(progn
    2649      (setf ,place
    2650            (ensure-value-of-type
    2651             ,place
    2652             ',typespec
    2653             ',place
    2654             ,string))
    2655      nil))
     2648  (let* ((val (gensym)))
     2649    `(do* ((,val ,place ,place))
     2650          ((typep ,val ',typespec))
     2651      (setf ,place (%check-type ,val ',typespec ',place ,string)))))
     2652
    26562653
    26572654
     
    35543551         (eintr (symbol-value (read-from-string "#$EINTR"))))
    35553552    `(loop
    3556       (let* ((,res ,@body))
     3553      (let* ((,res (progn ,@body)))
     3554        (unless (eql ,res (- ,eintr))
     3555          (return ,res))))))
     3556
     3557(defmacro ff-call-ignoring-eintr (&body body)
     3558  (let* ((res (gensym))
     3559         (eintr (symbol-value (read-from-string "#$EINTR"))))
     3560    `(loop
     3561      (let* ((,res (progn ,@body)))
     3562        (when (< ,res 0)
     3563          (setq ,res (%get-errno)))
    35573564        (unless (eql ,res (- ,eintr))
    35583565          (return ,res))))))
Note: See TracChangeset for help on using the changeset viewer.