Skip to content

Instantly share code, notes, and snippets.

@raspasov
Last active March 20, 2023 22:21
Show Gist options
  • Select an option

  • Save raspasov/c25c9b635fa9ef7c8743cb115dae45dd to your computer and use it in GitHub Desktop.

Select an option

Save raspasov/c25c9b635fa9ef7c8743cb115dae45dd to your computer and use it in GitHub Desktop.

Revisions

  1. raspasov revised this gist Mar 20, 2023. 1 changed file with 8 additions and 4 deletions.
    12 changes: 8 additions & 4 deletions core.clj
    Original file line number Diff line number Diff line change
    @@ -1,12 +1,16 @@
    (transduce
    (map-indexed (fn [idx item] [idx item]))
    (comp
    (map-indexed (fn [idx item] [idx item]))
    (map (fn [[idx item]]
    (println "sending to space" idx)
    [idx item])))
    (fn
    ;;completing arity
    ([accum] accum)
    ;;reduce arity
    ([accum [idx item]]
    (if (< 100 idx) ;; stop at 100
    (reduced accum) ;; stop
    (conj accum item)))) ;; else, continue
    (if (< 100 idx)
    (reduced accum)
    accum)))
    []
    (range))
  2. raspasov revised this gist Mar 20, 2023. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion core.clj
    Original file line number Diff line number Diff line change
    @@ -3,7 +3,7 @@
    (fn
    ;;completing arity
    ([accum] accum)
    ;;reduce arit
    ;;reduce arity
    ([accum [idx item]]
    (if (< 100 idx) ;; stop at 100
    (reduced accum) ;; stop
  3. raspasov created this gist Mar 20, 2023.
    12 changes: 12 additions & 0 deletions core.clj
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,12 @@
    (transduce
    (map-indexed (fn [idx item] [idx item]))
    (fn
    ;;completing arity
    ([accum] accum)
    ;;reduce arit
    ([accum [idx item]]
    (if (< 100 idx) ;; stop at 100
    (reduced accum) ;; stop
    (conj accum item)))) ;; else, continue
    []
    (range))