Why isn't my code printing like it should?

后端 未结 3 2031
伪装坚强ぢ
伪装坚强ぢ 2021-01-18 03:51

I\'m trying to create a for in Clojure.

I\'m following the cheats sheet from the Clojure site.

e.g:

(take 100 (for [x (range 100000000) y (ra         


        
3条回答
  •  北海茫月
    2021-01-18 04:10

    try adding doall in front: The for function creates a lazy sequence, as does take. They may not evaluate until you add a doall.

    This little quirk is a common annoyance in Clojure, but makes sense once you get more comfortable with "thinking lazily".

提交回复
热议问题