What are the advantages of scheme macros?

后端 未结 3 1355
小蘑菇
小蘑菇 2021-02-03 23:32

Why would anyone prefer Scheme macros over Common Lisp macros (and I genuinely want to know too, I\'m not trying to be a troll)?

My experience as a Lisp newb is that Com

3条回答
  •  逝去的感伤
    2021-02-03 23:52

    Scheme macros introduce two, essentially orthogonal, concepts: hygiene and pattern matching. Hygiene is less important in a lisp2 like Common Lisp. The pattern matching language captures many of the common macro idioms, but has the problem that it is essentially a different language from scheme. Probably the best introduction to scheme's macros, along with some of the rationale behind them is Shriram Krishnamurthi's PLAI chapters 36 and 37.

    I suspect that the reason people write scheme style macro systems in common lisp is more for the pattern matching than for the hygiene.

提交回复
热议问题