As follows from the main answer, the concat list is an intruder. Calling "doall", with this list as input ... will result in ISeq:
;;insertion sort helper (defn insert [sk] ;;find the insert point (let [spl (split-with
But wait ... Is the sequence still lazy?
The following hacked code, interestingly, indicates that the sequence is really still lazy!
;;insertion sort helper (defn insert [sk] ;;find the insert point (let [spl (split-with
So, if the list is still lazy, then why using doall doesn't fix anything?
The doall function is not guaranteed to return a non-lazy list, but rather, it ensures that the list it returns is evaluated by fully scrolling.
Thus, the essence of the problem lies in calling several functions, laziness is certainly related to this aspect of the code in your original question, but this is not the "primary" source of overflow.
source share