(defndivisible?"Determine if a number is divisible by the divisor with no remainders."[divnum](zero?(modnumdiv)))(defnfizz-buzz"Fizz if divisible by 3, Buzz if divisible by 5, FizzBuzz if div by both, n if neither."[n](cond->nil; threaded value starts with nil (falsey)(divisible?3n)(str"Fizz"); if true, adds Fizz to the threaded value (nil)(divisible?5n)(str"Buzz"); if true, adds Buzz to the threaded value (nil or Fizz):always-true(orn))); return the threaded value if not nil (Fizz/Buzz) or n(let[start1stop20](println"FizzBuzz:"start"-"stop)(doseq[x(rangestart(+1stop))](println(fizz-buzzx))))
One of the ways in Clojure:
Original idea seen here: clojuredocs.org/clojure.core/cond-...