This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-07-24
Channels
Is anyone aware of any structural diffing tools for clojure other then https://fazzone.github.io/autochrome.html?
i'll look into that. Last i checked it didn't easily integrate into emacs.
https://github.com/dandavison/delta has emacs support but it's not language specific
Question on compilation (to be more precise, evaluation process). Given a file x.clj,
(ns x)
(defmacro mac
[]
(println "asdf"))
(println "go")
(mac)
After run I
clj -M x.clj
The output is
go
asdf
Naturally this looks right. But it is said that clojure evaluation process is:
1. Read the clj file
2. Expand all the macros if possible
3. Emit bytecode for execution
4. Execute bytecode
So given the above model, I’d expect “asdf” is first printed which is at phase 2, and “go” is printed later at phase 4.
Obviously, this conflicts with the actual result.
So my question is, what’s the right mental understanding of the clojure evaluation/compilation process.That's because 1 is the faulty assumption. There is no real concept of file, the reader reads forms one at a time