Fork me on GitHub
#clojure-miami
<
2016-01-28
>
christianromney00:01:20

there are two macro-expansions available:

christianromney00:01:14

macroexpand-1 or macroexpand-all

christianromney00:01:26

a macro is a code-rewriter or template engine

christianromney00:01:48

think of it like a super-powerful search-and-replace for code

christianromney00:01:26

kind of how the C language has a pre-processor which handles #define statements

christianromney00:01:41

Clojure’s macros are evaluated at “compile” time

christianromney00:01:15

and they re-write your code (usually to a longer version)

christianromney00:01:32

macros can generate code that contains. … other macros

christianromney00:01:48

this re-writing (or expansion) is recursive

christianromney00:01:17

but eventually you will hit something truly “primitive” like a function

christianromney00:01:29

macroexpand-1 only does 1 level of macro rewriting

christianromney00:01:56

macroexpand-all will go all the way down the rabbit hole and do all of the recursive expansion till you ground out

christianromney14:01:56

cool, spread the word this is the best channel to hang out in for Miami Clojure Meetup.

christianromney14:01:22

there are lots of other interesting channels, mainly for asking questions about Clojure (#C03S1KBA2), ClojureScript (#C03S1L9DN) setting up Emacs and Cider #C099W16KZ and #C0617A8PQ respectively for Clojure/ClojureScript development etc.

christianromney14:01:45

there’s also #C03RZRRMP and #C05006WDW which may be of interest...

christianromney14:01:08

oh and #C053PTJE6 which are a great way to get constructive criticism

maddie15:01:37

Just signed up! simple_smile