Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

Whats the difference between a macro and a function?

function macro
0
10 Posted

Whats the difference between a macro and a function?

0

Quoting from the Lisp Reference (a.k.a Lispref) Manual: Macros enable you to define new control constructs and other language features. A macro is defined much like a function, but instead of telling how to compute a value, it tells how to compute another Lisp expression which will in turn compute the value. We call this expression the expansion of the macro. Macros can do this because they operate on the unevaluated expressions for the arguments, not on the argument values as functions do. They can therefore construct an expansion containing these argument expressions or parts of them. Do not confuse the two terms with keyboard macros, which are another matter, entirely. A keyboard macro is a key bound to several other keys. Refer to manual for details.

0

Quoting from the Lisp Reference (a.k.a lispref) Manual: Macros enable you to define new control constructs and other language features. A macro is defined much like a function, but instead of telling how to compute a value, it tells how to compute another Lisp expression which will in turn compute the value.

0

Quoting from the Lisp Reference (a.k.a Lispref) Manual: Macros enable you to define new control constructs and other language features. A macro is defined much like a function, but instead of telling how to compute a value, it tells how to compute another Lisp expression which will in turn compute the value. We call this expression the expansion of the macro. Macros can do this because they operate on the unevaluated expressions for the arguments, not on the argument values as functions do. They can therefore construct an expansion containing these argument expressions or parts of them. Do not confuse the two terms with keyboard macros, which are another matter, entirely. A keyboard macro is a key bound to several other keys. Refer to manual for details.

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.