Skip to main content

All Questions

Tagged with
12 votes
1 answer
2k views

What practical problem results from lack of hygienic macros in Clojure?

I've heard that Clojure macros are easier to write but not as reliable as Racket's hygienic macros. My question has 2 parts: How does gensym differ from hygienic macros? What do Racket macros provide ...
Alex's user avatar
  • 284
7 votes
1 answer
1k views

Is it fair to say that "macros don't compose"?

On this blog post aphyr (who is a brilliant programmer) states: Clojure macros come with some important restrictions. Because they’re expanded prior to evaluation, macros are invisible to functions. ...
hawkeye's user avatar
  • 4,859
20 votes
5 answers
5k views

Python decorators and Lisp macros

When looking Python decorators someone made the statement, that they are as powerful as Lisp macros (particularly Clojure). Looking at the examples given in PEP 318 it looks to me as if they are just ...
Profpatsch's user avatar
8 votes
3 answers
3k views

When would I require a Macro instead of a function?

I am new to Clojure, I am new to Macros and I have no prior background in Lisp. I went on to create my own switch case like form and ended up with this: (defmacro switch-case [v cases default] (if (...
Amogh Talpallikar's user avatar
11 votes
3 answers
1k views

Byte code weaving vs Lisp macros

I have been reading about the libraries people have written for languages like Java and C# that make use of byte code weaving to do things like intercept function calls, insert logging code, etc. I ...
mortalapeman's user avatar
  • 1,611