|
|
|
|
|
by dragandj
4896 days ago
|
|
I admit I didn't have enough time to try your code, so excuse me if I made some oversight, but it seems to me that the basic oversight that you made is that there are two steps that clojure compiler does with the code. In the first step, all macros are expanded, replacing all macro calls with the actual code they generate. Then, the resulting, "macro-free" code is compiled to bytecode.
So, you can try macro calls as many times as you want: all calls with the same arguments (which are clojure forms, that is - code, and not the actual values of that code in the runtime) result in exactly the same code. 5s 8s and all the data from your example does not exist yet in that moment.
Then, the transparency of functional calls is as advertised: it is referentially transparent if your code is pure (no Java calls etc.).
I think the misunderstanding was in forgetting that macros are expanded and gone long before your code starts to run... |
|