What is the difference between defn and defmacro?

后端 未结 5 1373
青春惊慌失措
青春惊慌失措 2021-02-01 02:25

What is the difference between defn and defmacro? What is the difference between a function and a macro?

5条回答
  •  后悔当初
    2021-02-01 03:21

    defn define a function, and defmacro define a macro.
    Macro is like a function but treat it's argument (if they are expressions as data), then process them and return data (list of symbols which are the code) and then evaluate that return code. So it's replace one code with another (on compile time).

提交回复
热议问题