Fork me on GitHub
Lucas Barbosa01:09:58

I am reading the “Clojure Programming” book (by Chas Emerick) and something made me intrigued. It mentions the “head retention” problem, with an example. Here’s the example: This apparently causes an OutOfMemoryError: `(let [[t d] (split-with #(< % 12) (range 1e8))] [(count d) (count t)])` While this doesn’t: `(let [[t d] (split-with #(< % 12) (range 1e8))] [(count t) (count d)])` The explanation is: “Since the last reference to t occurs before the processing of d, no reference to the head of the range is kept, and no memory issues arise.” I read this many times and I simply cannot understand the reason why this is happening. Can someone help me to understand this?


How can I include all clojure core libraries in a file so I don't have to fully qualify functions (clojure.string/upper-case "string") vs (upper-case "string")


Its 100% bad practice, so much so ClojureScript decided to just remove the feature completly.


Use :as for alias always.


Using fully qualified is also bad practice. Alias is always the way to go.


Thank you! I had a feeling that was a bad idea, sure enough when I tried it I immediately got namespace collision related Warnings in REPL, so I switched to using :as and will be doing so from here out


or is that bad practice...


@dannystanny01 (require [clojure.string :refer :all])


Something like this, afaik it’s not a bad practice


hi all, pls could you advise how do I use apache derby within a lein project