Don't know if you'll find this useful, but your code reminded me of a somewhat similar macro I made called 'wrap-func':
Code Select
(define-macro (wrap-func func-sym wrapper , wrapped-func)
(setf wrapped-func (sym (string func-sym "|wrapped#" (inc wrap-func.counter))))
(set wrapped-func (eval func-sym))
(set func-sym (eval (expand wrapper 'wrapped-func)))
)
An example usage:
Code Select
(wrap-func db:execute-update (fn ()
(unless (apply wrapped-func $args)
(error-out "execute-update failed: " $args)
)
))
Now when db:execute-update gets called, the function above is called instead, which then calls the real execute-update function (via 'wrapped-func') and outputs an error message if it fails.
Edit: It's available as part of