meander

Tommi Martin 2024-09-05T13:01:32.727679Z

Lifting this up here aswell in case someone smarter than me can explain what is going on or if we hit a bug: me and @partosqq encountered a very curious issue with meander and loops. With the following code:

(def meander-loop
    (loop []
      (clojure.pprint/pprint "debug")
      (m/match {:debug "hello"
                :other "stuff"}
        {:debug ?test}
        (do (Thread/sleep 500)
            (clojure.pprint/pprint "pending loop triggered")
            (recur))
        _ :ok)))
When you run the loop. You would expect two things to happen: First. for some reason the above code doesn't throw Can only recur from tail position which I think it should? It starts throwing it if you remove _ :ok Second. For every loop iteration i expected (clojure.pprint/pprint "debug") to leave something in the console right? That doesn't happen: this is the console output of the above
; "debug"
; "pending loop triggered"
; "pending loop triggered"
; "pending loop triggered"
; "pending loop triggered"
; "pending loop triggered"
; "pending loop triggered"
; "pending loop triggered"