14

I just "discovered" the #= reader macro from a post on Stackoverflow and it solves a problem. How likely is this reader macro to become an official (documented) part of the language? How about deprecated or changed behavior?

The #= reader macro causes the following s-expression to be evaluated by the Lisp reader (before macro expansion).

Community
  • 1
  • 1
Ralph
  • 31,584
  • 38
  • 145
  • 282

2 Answers2

5

It is used by the core language when something is printed with *print-dup* true, so I'd wager that it is going to stay. No idea why it is not documented.

user=> (binding [*print-dup* true] (prn {:foo 1 :bar 2}))
#=(clojure.lang.PersistentArrayMap/create {:foo 1, :bar 2})
nil
Jouni K. Seppänen
  • 43,139
  • 5
  • 71
  • 100
  • Thanks. I also wonder why it's not documented. It would be useful in macros to evaluate a sub-expression before the macro expands. – Ralph Jun 21 '11 at 20:52
3

It's not documented because it could go away / be replaced with something else. I wouldn't recommend using it in your programs.

solussd
  • 494
  • 5
  • 7