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?

Drew
  • 75,699
  • 9
  • 109
  • 225
nomad
  • 247
  • 1
  • 6
  • https://emacs.stackexchange.com/tags/elisp/info – Drew Sep 27 '20 at 01: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 Sep 27 '20 at 05:55

1 Answers1

2

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

db48x
  • 15,741
  • 1
  • 19
  • 23
  • Isn't there one for `apply`? Or a way to convert a list into its elements, prefereably without evaluating them? – nomad Sep 27 '20 at 05: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 Sep 27 '20 at 06:17
  • Alright, thanks for reply. Maybe we can chat. – nomad Sep 27 '20 at 06:53