I've tried using functionp and fboundp, and am wondering what the difference is and how they can be used to maybe-call a function.
(functionp OBJECT)
- Non-nil if OBJECT is a function.
(fboundp SYMBOL)
- Return t if SYMBOL's function definition is not void.
For example, I'm trying to do:
(if (python-shell-get-buffer)
....
....
But python-shell-get-buffer doesn't get defined until run-python has been run.
If I just try to call it, before its defined, I get:
Symbol's function definition is void: python-shell-get-buffer
I've tried using
(if (and (fboundp python-shell-get-buffer) (python-shell-get-buffer))
and
(if (and (functionp python-shell-get-buffer) (python-shell-get-buffer))
but they also result in
Symbol's value as variable is void: python-shell-get-buffer
How do I call a function which may or may not be defined ?