I'm confused about return value of apply-partially
. Documentation states that it returns a function, and source of the function shows that it actually retruns a lambda. But I can't invoke the return value directly, only via funcall
. Creating lambda directly at the call place allows me to invoke it directly.
Here are three examples of what am I talking about:
((apply-partially 'string-prefix-p ".") ".emacs")
;; => (invalid-function (apply-partially 'string-prefix-p "."))
((lambda (x) (string-prefix-p "." x)) ".emacs")
;; => t
(funcall (apply-partially 'string-prefix-p ".") ".emacs")
;; => t
Why is it working in such way?