I cannot say this is the easiest thing I have ever written. #lisp
(defun fizzbuzz-of (x)
(let* ((nos (scan-range))
(fizz-src (series 'fizz))
(buzz-src (series 'buzz))
(by3s (scan-range :from 0 :by 3))
(by5s (Scan-range :from 0 :by 5))
(fizzes (mask by3s))
(buzzes (mask by5s))
(fizz/buzzes (#Mlist (#Mand fizzes fizz-src)
(#Mand buzzes buzz-src))))
(or (collect (choose-if #'identity
(scan (collect-nth x fizz/buzzes))))
(list (collect-nth x nos)))))
https://mastodon.sdf.org/@screwtape/113495926075576556
2024-11-17 screwtape ┃ edited ┃ 1👤 2💬
EDIT: It turns out I have to take the (unnecessary) consing out of my let and then Series clearly wins.
Who named this "lazy" ?
@fosskers was it you?
────
────