clojure-miami

[Miami Clojure] Tonight: Introduction to ClojureScript Part 2 @ Orange Republic!
christianromney 2016-01-28T00:23:59.000006Z

re: macroexpand

christianromney 2016-01-28T00:24:20.000007Z

there are two macro-expansions available:

christianromney 2016-01-28T00:25:14.000008Z

macroexpand-1 or macroexpand-all

christianromney 2016-01-28T00:25:26.000009Z

a macro is a code-rewriter or template engine

christianromney 2016-01-28T00:25:48.000010Z

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

christianromney 2016-01-28T00:26:26.000011Z

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

christianromney 2016-01-28T00:26:41.000012Z

Clojure’s macros are evaluated at “compile” time

christianromney 2016-01-28T00:27:15.000013Z

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

christianromney 2016-01-28T00:27:32.000014Z

macros can generate code that contains. … other macros

christianromney 2016-01-28T00:27:48.000015Z

this re-writing (or expansion) is recursive

christianromney 2016-01-28T00:28:17.000017Z

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

christianromney 2016-01-28T00:30:29.000018Z

macroexpand-1 only does 1 level of macro rewriting

christianromney 2016-01-28T00:30:56.000019Z

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

christianromney 2016-01-28T14:53:56.000021Z

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

christianromney 2016-01-28T14:55:22.000022Z

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.

christianromney 2016-01-28T14:55:45.000023Z

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

christianromney 2016-01-28T14:56:08.000024Z

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

2016-01-28T15:03:47.000026Z

yay! :simple_smile:

christianromney 2016-01-28T15:19:26.000027Z

@maddie: may be of interest to you http://www.clojurebridge.org/

2016-01-28T15:50:37.000028Z

Just signed up! :simple_smile: