~nasser/8fl

8fl/core-macros.fnl -rw-r--r-- 252 bytes
2934f9e8Ramsey Nasser Use negative track numbers for fx columns a month ago
                                                                                
1
2
3
4
5
6
7
8
9
10
(fn resumable [...]
  `(let [thunk# (fn [] (do ,...))]
     (coroutine.wrap
      #(while true
         (let [f# (coroutine.wrap thunk#)]
           (each [x# f#]
             (coroutine.yield x#))
           (coroutine.yield nil))))))

{ : resumable }