Lisp macro special use?

I recently read a book by hackers and artists. The author said that the Lisp macro is very powerful and special than another language macro.

I started to study the ELisp macro, but still don’t see what use is it? I do not see the difference between it and the C / C ++ macro.

Can anyone explain this to me?

+3
source share
2 answers

I think the most important points are:

  • Lisp , Lisp Lisp (- Lisp , , Lisp LISt Processing), . (Homoiconicity) C/++, , . C/++ ( ). C/++ , . , , ( , ..), . ( , .)

  • Lisp , . , .

  • Lisp, , C/++ , , .

  • ( ) C/++. ( gensym , , with-gensyms .. CL, , .)

  • Lisp - " " , .

, Lisp , C/++. , Lisp . , DSL . C/++, , , - , .

- C/++:

(defmacro bif ((var expression) then &optional else)
  `(let ((,var ,expression))
     (if ,var ,then ,else)))

bif ( "binding if" ), , then else ​​ . , . Lisp, . , Lisp , - .

( C/++, , - Lisp cond , .)

+4

Lisp , ++. Lisp - , , .

, Lisp ~ 25 " ", . Lisp . ELisp, Common Lisp loop . - Lisps , Lisp . defun, , , , .

++, , , , , . Lisp, , , , , , .

, , , - . , , .

+3

All Articles