Function: gv-delay-error

gv-delay-error is a macro defined in gv.el.gz.

Signature

(gv-delay-error PLACE)

Documentation

Special place which delays the gv-invalid-place error to run-time.

It behaves just like PLACE except that in case PLACE is not a valid place, the gv-invalid-place error will only be signaled at run-time when (and if) we try to use the setter. This macro only makes sense when used in a place.

Source Code

;; Defined in /usr/src/emacs/lisp/emacs-lisp/gv.el.gz
(defmacro gv-delay-error (place)
  "Special place which delays the `gv-invalid-place' error to run-time.
It behaves just like PLACE except that in case PLACE is not a valid place,
the `gv-invalid-place' error will only be signaled at run-time when (and if)
we try to use the setter.
This macro only makes sense when used in a place."
  (declare
   (gv-expander
    (lambda (do)
      (condition-case err
          (gv-get place do)
        (gv-invalid-place
         ;; Delay the error until we try to use the setter.
         (funcall do place (lambda (_) `(signal ',(car err) ',(cdr err)))))))))
  place)