Interface, by example:
(my-run-command '(my-append (3 6 8) (4 5)))
(3 6 8 4 5)
Implementation, with bits missing:
(defun my-run-command (command) (let ((my-append 'append)) […]))
(eval (cons 'funcall command)), but that tries to evaluate
(3 6 8), which results in an error message.
commandin your implementation. Maybe that's one of the missing bits, but it's hard to know what you're trying to do. A wild guess is that you should maybe be using
let, but again, I have no idea what you're trying to do or asking. If you have trouble clarifying your question, consider showing more code and saying what you expect it to do and what it does that you don't want/expect.
letdoes not bind the function definition to the symbol’s function cell. So the symbol cannot be executed as function with
apply. I actually, did discover
fletbefore asking the question, but I didn’t know that it needs to be called using
cl-flet(although it is possible to enable an alias to
flet– it works on my other system). Also, I didn’t know about
#'which is part of the answer by @phils.