0

Please look at the following elisp expressions.

(funcall 'lambda '() 1)
;; or
(apply 'lambda '() 1 ())

The interpreter says that lambda is not a valid function for both the above expressions. Why? Is it because lambda is a macro? If so, is there a variant of funcall/apply for macros?

2
  • emacs.stackexchange.com/tags/elisp/info
    – Drew
    Commented Sep 27, 2020 at 1:22
  • @Drew, understood. I mistook the number of watchers with the number of posts for each tag and was wondering why they were few.
    – nomad
    Commented Sep 27, 2020 at 5:55

1 Answer 1

2

Yes, lambda is a macro. There is a function that is like funcall for macros called eval.

3
  • Isn't there one for apply? Or a way to convert a list into its elements, prefereably without evaluating them?
    – nomad
    Commented Sep 27, 2020 at 5:58
  • No, eval is not split into two variants like funcall and apply. I have no idea what you mean about converting a list to it's elements; if you want to access the elements of a list you can use nth or, car and cdr. Perhaps you need to ask a better question, one that is focused on what you actually want to accomplish instead of random primitive operations. For more information about primitives, you can open the Elisp manual inside Emacs with C-h i.
    – db48x
    Commented Sep 27, 2020 at 6:17
  • Alright, thanks for reply. Maybe we can chat.
    – nomad
    Commented Sep 27, 2020 at 6:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.