Skip to content

bsvingen/clojure.counter

Repository files navigation

travis-ci.org

clojure.counter

Leiningen coordinate:

[com.borkdal/clojure.counter "0.1.0"]

This is a simple Clojure library for counting things, and invoking side-effects at counts qualifying a provided predicate.

For instance, if you want to print a message every 100 counts, do something like this:

(def c (make-counter #(= 0 (mod % 100))
					 #(println "We have now counted to" %)))

Then call

(tick c)

to increase the counter by one.

About

A simple counting library for Clojure

Resources

License

Stars

Watchers

Forks

Packages

No packages published