Hacker News new | ask | show | jobs
by phronmophobic 1373 days ago
> although I'll note that there are plenty of ways (most of them via Java interop) to introduce mutability of some kind into a Clojure program besides the first-class reference types (atoms/refs/agents/volatiles.)

Fair point, I tried to word that statistic accurately without being too verbose.

> I'd be interested in an analysis in what percentage of Clojure functions are truly referentially transparent, but that's difficult (if not impossible) to determine statically.

Absolutely, I'm not sure it's possible or even practical to measure functional purity in an absolute sense, but there's definitely room for improvement:

- measure Java Interop

- measure usage of mutation functions (eg. swap!, set!, binding, send, vswap!, alter, etc)

- measure (def ^:dynamic *my-var*) usages

My intuition is that the numbers wouldn't change that much, but I'd rather have the data than guess.