frenchy64/analyze — Issue #5: Exponentially large maps
Author: jonase
Created: 2012-01-09 15:04:19+00:00
State: open

Having a `:children` key yields exponentially large maps. They are not strictly necessary since all they essentially do is duplicate information already available in the map. They are, however, very useful for code walking tasks.

One possible solution is to make a `children` multimethod (dispatching on `:op`) which would return the same expressions as `:children` does now.

I have created a [branch](https://github.com/jonase/analyze/tree/children-multifn) which implements the above idea, and it seems to work great so far. Would you consider accepting a pull request when I'm confident that it works and when I have converted the examples to use the `children` function instead of `:children`?

Currently, the expression,

(binding [*out* (writer "master.out")]
(println (analyze-one {:ns {:name 'user} :context :eval}
'(let [d (fn [x] (* x x))]
(println "2*3 =" (d 3))))))

creates a **27M** file. With my (still experimental branch) it's "only" 8K (a ~3500x reduction in size)