In the inline code, replace (put. env val) with (.put env val).
In the code block, replace for with doseq.
But that won't solve the exception. It seems like you're hitting either https://clojure.atlassian.net/browse/CLJ-1243 (even though the description is not entirely the same, the root cause might be) or something very similar, and I can also reproduce it.
In order to fix it, add a type annotation: (.put ^java.util.Map environment env val).