* Any reasons against having `fboundp-and-funcall' (equivalent to `bound-and-true-p')?
@ 2023-06-21 14:29 Jens Schmidt
2023-06-21 15:02 ` [External] : " Drew Adams
0 siblings, 1 reply; 2+ messages in thread
From: Jens Schmidt @ 2023-06-21 14:29 UTC (permalink / raw)
To: emacs-devel
I was delighted when I recently came across `bound-and-true-p' in
standard Emacs. But what about `fboundp-and-funcall'? Like this:
(defmacro fboundp-and-funcall (function &rest arguments)
`(let ((function ,function))
(and (fboundp function)
(funcall function ,@arguments))))
;; arguments not eval'ed in case of failure
(fboundp-and-funcall #'foo (setq baz 'bar))
nil
(boundp 'baz)
nil
(fboundp-and-funcall #'identity 'foo)
foo
WDYT?
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-06-21 15:02 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-06-21 14:29 Any reasons against having `fboundp-and-funcall' (equivalent to `bound-and-true-p')? Jens Schmidt
2023-06-21 15:02 ` [External] : " Drew Adams
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.