I am recently learning scheme and curious at a design that a macro can't be evaluated without an identifier, while a lambda(procedure) can be done so.
For example, I can use an anonymous lambda as this:
((lambda x x) 1 2 3)
Where it seems I have to define a macro using the following syntax:
(define-macro my-macro (lambda x x))
I am curious why there's so a such method do create a macro directly like this:
(define my-macro (macro-lambda x x))
I suppose if regard a macro and a lambda as different types, the second one might be more elegant.
My questions are:
- what does
define-macro
do? - what's the fundamental difference between a macro and a lambda?
- are there anonymous macros in scheme, if not, why?