Use of Clojure macros for DSLs

前端 未结 4 2416
面向向阳花
面向向阳花 2021-02-20 06:14

I am working on a Clojure project and I often find myself writing Clojure macros for DSLs, but I was watching a Clojure video of how a company uses Clojure in their real work an

4条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2021-02-20 07:16

    Yes!

    Write functions whenever possible. Never write a macro when a function will do. If you write to many macros you end up with somthing that is much harder to extend. Macros for example cant be applied or passed around.

    Christophe Grand: (not= DSL macros)

    http://clojure.blip.tv/file/4522250/

提交回复
热议问题